1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
maListViewPerso = (ListView) findViewById(R.id.listView1);
ArrayList<HashMap<String, String>> listItem = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
map = new HashMap<String, String>();
map.put("titre", "pseudo1");
map.put("description", "...");
map.put("img", String.valueOf(R.drawable.social_person));
listItem.add(map);
map = new HashMap<String, String>();
map.put("titre", "pseudo2");
map.put("description", "...");
map.put("img", String.valueOf(R.drawable.social_person));
listItem.add(map);
(...)
SimpleAdapter mSchedule = new SimpleAdapter (this.getBaseContext(), listItem, R.layout.affichageitem,
new String[] {"img", "titre", "description"}, new int[] {R.id.img, R.id.titre, R.id.description});
maListViewPerso.setAdapter(mSchedule);
maListViewPerso.setItemsCanFocus(true); |
Partager