我正在实施SimpleAdapter
这样的:
List<Map> data = getDrawerData();
SimpleAdapter adapter = new SimpleAdapter(this, data,R.layout.drawer_list_item,new String[] {"drawer_icon","drawer_text"},new int[] {R.id.drawer_icon, R.id.drawer_text});
但是,第二行给了我这个错误:
构造函数 SimpleAdapter(MainActivity, List, int, String[], int[]) 未定义
Two fixes
1. Cast argument 'data' to 'List<? extends Map<String, ?>>'
或者
2. Change type of 'data' to 'List<? extends Map<String, ?>>'
我选择了该Cast
选项,但这仅显示抽屉列表项的图标,而不是它们的TextView
标签...
我跟着这个教程:http ://shenhengbin.wordpress.com/2012/03/17/listview-simpleadapter/