1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| mList = (ListView)findViewById(R.id.activiteJour);
String[][] repertoire = new String[][]{
{"Séance Aquagym", "Heure de début : " + hd, "Heure de fin : " + hd, "Lieu" + l},
{"Rendez vous Dr Rouillet", "Heure de début : " + hd, "Heure de fin : " + hd, "Lieu" + l},
{"Visio Julie", "Heure de début : " + hd, "Heure de fin : " + hd, "Lieu" + l}};
List<HashMap<String, String>> liste = new ArrayList<HashMap<String, String>>();
HashMap<String, String> element;
for(int i = 0 ; i < repertoire.length ; i++) {
element = new HashMap<String, String>();
element.put("text1", repertoire[i][0]);
element.put("text2", repertoire[i][1]);
liste.add(element);
}
ListAdapter adapter = new SimpleAdapter(this, liste, android.R.layout.simple_list_item_2, new String[] {"text1", "text2"}, new int[] {android.R.id.text1, android.R.id.text2 });
mList.setAdapter(adapter); |