I have a scenario here,i want to pass the desired json object on the list item click in my below activity
you can pass JsonObject from JsonArray according to ListView item clicked Position as:
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView> arg0, View arg1,
final int arg2, long arg3) {
if(!jArray.isNull(arg2)){
Intent intent = new Intent(context,Finaldeal.class);
intent.putExtra("deal", jArray.optJSONObject(arg2).toString());
startActivity(intent);
}
}
});
currently you are passing json_data which always contain last JSONObject from JSONArray when for loop execution end