Em terça-feira, 9 de junho de 2015 19:10:05 UTC-3, Vinny Valente escreveu:
Olá galera,...Tenho uma ListView com Adapter que é a primeira tela e a principal do meu app. Quando abre o aplicativo já carrego ela via json, porem a cada 10 registros os mesmos se repetem.Verifiquei a listas no debug e esta OK, porem na tela se repetem.Outra coisa que esta acontecendo é quando a tela é movida para baixo para ver outros registros e retorno ao inicio dela, o primeiro registro esta trocado por outro.Alguém tem ideia?Segue o código@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceSt
ate );setContentView(R.layout.activi
ty_main );
mNavigationDrawerFragment = (NavigationDrawerFragment)
getSupportFragmentManager().fi
ndFragmentById (R.id.navigation_drawer );mTitle = getTitle();
mNavigationDrawerFragment.setU
p (R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_
layout ));
rq = Volley.newRequestQueue(MainAct
ivity .this);
callByJsonObjectRequest(null);
}
public void callByJsonObjectRequest(View view){
Log.i("Script", "ENTREI: callByJsonObjectRequest()");
params = new HashMap<String, String>();
params.put("method", "web-data-jor");
CustomJsonObjectRequest request = new CustomJsonObjectRequest(Method
. POST,url,
params,
new Response.Listener<JSONObject>(
){ @Override
public void onResponse(JSONObject response) {
Log.i("Script", "SUCCESS: "+ response);
trataJSON(response);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(MainActivity.th
is , "Error: "+ error.getMessage(), Toast.LENGTH_LONG).show();}
});
request.setTag("tag");
rq.add(request);
}
public void trataJSON(JSONObject response){
JSONArray retorno = null;
try {
retorno = response.getJSONArray("
retorno" );
} catch (JSONException e) {
e.printStackTrace();
}
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






0 comentários:
Postar um comentário