you use "this.setListAdapter" two times, only the second "this.setListAdapter" will reflect.
For your requirement use
1)custom arrayadapter<customObject>
or
2)simpleadapter.
1) Using a custom array, please check http://devtut.wordpress.com/2011/06/09/custom-arrayadapter-for-a-listview-android/
2) Using SimpleAdapter:
List<Map<String, String>> data = new ArrayList<Map<String, String>>();
for (int i=0; i<titles_str.length; i++) {
Map<String, String> datum = new HashMap<String, String>(2);
datum.put("title", titles_str[i]);
datum.put("subtitle", String.valueof(subtitles_str[i]));
data.add(datum);
}
SimpleAdapter adapter = new SimpleAdapter(this, data,
android.R.layout.simple_list_item_2,
new String[] {"title", "subtitle"},
new int[] {android.R.id.text1,
android.R.id.text2});
this.setListAdapter(adapter);
source
share