c.getLong(c.getColumnIndex(" _id"))总是返回0

时间:2015-11-07 19:20:31

标签: android

单击listview项目时尝试更新数据库

正确获取其他字段,但_id始终返回0

int Column1 = c.getColumnIndex(" DESC");   int Column2 = c.getColumnIndex(" AMOUNT");

long id_ = c.getLong(c.getColumnIndex(" _id"));

主:   String [] from = new String [] {" _id"," DESC"," AMOUNT"};         int [] to = new int [] {R.id.list_content1,R.id.list_content2,R.id.list_content1};         cursorAdapter =                 new SimpleCursorAdapter(getContext(),R.layout.my_list_item2,c,from,to);

0 个答案:

没有答案