首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

listView 多值展示

2012-09-29 
listView 多值显示ListView list (ListView) findViewById(R.id.SCHEDULE)?ArrayListHashMapString,

listView 多值显示

ListView list = (ListView) findViewById(R.id.SCHEDULE);?ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();HashMap<String, String> map = new HashMap<String, String>();map.put("train", "101");map.put("from", "6:30 AM");map.put("to", "7:40 AM");mylist.add(map);map = new HashMap<String, String>();map.put("train", "103(x)");map.put("from", "6:35 AM");map.put("to", "7:45 AM");mylist.add(map);// ...mSchedule = new SimpleAdapter(this, mylist, R.layout.row,            new String[] {"train", "from", "to"}, new int[] {R.id.TRAIN_CELL, R.id.FROM_CELL, R.id.TO_CELL});list.setAdapter(mSchedule);

热点排行