0
I’m having difficulty passing the parameter inside the repetition for in Android Studio. It lists the data coming from mysql, but I can’t pass the parameter to access the item.
for (int i=0; i<=ja.length(); i++){
jo = ja.getJSONObject(i);
numChamado[i] = jo.getString("numChamado");
nomeCliente[i] = jo.getString("nomeCliente");
logradouro[i] = jo.getString("logradouro");
nome[i] = jo.getString("nome");
processo[i] = jo.getString("processo");
cidade[i] = jo.getString("cidade");
lstData.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(getApplicationContext(), DescItem.class);
intent.putExtra("numChamado",numChamado[i]);
intent.putExtra("nomeCliente",nomeCliente[i]);
intent.putExtra("logradouro",logradouro[i]);
intent.putExtra("processo", processo[i]);
startActivity(intent);
}
});
}