I have loaded data to normal list view from JSON array like this
JSONArray jArray = new JSONArray(result);
final String[] array_spinner = new String[jArray.length()];
for(int i=0;i<jArray.length();i++){
JSONObject json_data = jArray.getJSONObject(i);
String jj=json_data.getString("f_name");
array_spinner[i] = jj;
}
ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_list_item_1,array_spinner); adapter.setDropDownViewResource(android.R.layout.simple_list_item_1);
//adapter.setDropDownViewResource(R.layout.spinner_layout);
list.setAdapter(adapter);
I want to load the data to custom listview. my XML file for custom listview is this receiver.xml
How can I load data to custom listview from JSON?
as in
http://www.josecgomez.com/2010/05/03/android-putting-custom-objects-in-listview/
Populate Listview from JSON
for you i mixed both to make you understand...
Activity XML
list row XML (in layout row.xml)
you adapter class
your activty