I have a problem to parsing from JSON to Listview in Android. This is an example of data from JSON :
[{
\"area\": \"Kebon Jeruk\",
\"city\": \"Jakarta\"
JSONArray arr = new JSONArray(yourJSONresponse);
List list = new ArrayList();
for(int i = 0; i < arr.length(); i++){
String info = arr.getJSONObject(i).getString("area") + arr.getJSONObject(i).getString("city");
list.add(info);
}
And then just turn the List into an Array of Strings, and use an adapter to fill the ListView
like so:
ArrayAdapter adapter = new ArrayAdapter(this,R.layout.ListView,StringArray);
ListView listView = (ListView) findViewById(R.id.listview);
listView.setAdapter(adapter);