you can take a look at this webpage that has an example that you can do exactly as you are looking for: http://p-xr.com/android-tutorial-how-to-parse-read-json-data -into-a-android-listview /
Basically, inside the for loop in which you print the names, you should load a list of arrays containing the values that you want to insert into the list later. Note that this example uses the following:
ArrayList< HashMap < String, String > > mylist = new ArrayList < HashMap < String, String > > ();
And you have an integer and a string to add to the structure so that you can simply turn that identifier into a string and solve the problem. After that, you can use the list adapter without having to create a separate class:
ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main, new String[] { "name", "id" }, new int[] { R.id.item_title, R.id.item_subtitle });
If the "name" and "id" are the keys on your map for the name and identifier values returned by json and item_title, item_subtitle types to "adapt" the text.
Hopefully I was clear enough, take a look at this example, in any case, quite simply.
source share