简体   繁体   中英

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

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM