Sampath Kumar
Sampath Kumar

Reputation: 1660

How to add items in two columns in Listview (Android)?

I have worked in Listview, I have stored values in arraylist1 and arraylist2, then retrieve the value from arraylist1, arraylist2 and then insert these two arraylists values in each row, how? Please can any one help me?

Thanks

Example:

arraylist1 - 23/1/12
arraylist2 - welcome

These two values are inser in Listview

ListView - 23/1/12     welcome

Upvotes: 0

Views: 6801

Answers (1)

user370305
user370305

Reputation: 109237

You can use Multicolumn ListView in Android. And add your arraylists values in

ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map = new HashMap<String, String>();
map.put("Value1", arrayList1.get(0));
map.put("Value2", arrayList2.get(0));
mylist.add(map);

Upvotes: 4

Related Questions