final SQLiteDatabase db = openOrCreateDatabase("record",MODE_PRIVATE,null);
ListView listView=(ListView)findViewById(R.id.listView);
map_list=getDataSource(db);
SimpleAdapter adapter = new SimpleAdapter(this,map_list,R.layout.listview,
new String[] { "time", "time1","type","type1","money","money1"},
new int[] { R.id.textView1,R.id.textView2,R.id.textView3,R.id.textView4,R.id.textView5,R.id.textView6});
listView.setAdapter(adapter);
public static List> getDataSource(SQLiteDatabase db) {
List> map_list = new ArrayList>();
Map map = new HashMap();
Cursor cursor = db.rawQuery("select * from record where name = ?",new String[] {name} );
while (cursor.moveToNext()) {
String type = cursor.getString(2);
String money = cursor.getString(1);
map = new HashMap<String, String>();
map.put("time", "时间:");
map.put("time1", time);
map.put("type", "类型:");
map.put("type1", type);
map.put("money", "金额:");
map.put("money1", money);
map_list.add(map);
}
return map_list;
}
cursor就是出错,麻烦帮忙看下哪里出错