Hello, is it possible to populate a listview based on a row Id from a custom cursor adapter. I keep getting an error "illegalArguementException column: _id does not exist". but the database has it and is already being used correctly. I don't know what to do, because I would need to populate different listviews from the same database and i don't want to have to create multiple database which will still have the same column names. Any ideas will be greatly appreciated. thanks
HERE is the database code is being cold:
public Cursor retrieveItemRow(long Id){
open();
String[] Columns = new String[] {TITLE,DATE, TIME};
Cursor row = db.query(true,DATABASE_TABLE, Columns, KEY_ID +"=" +Id, null, null, null, null,null);
if(row != null){
row.moveToNext();
return row;
}
return row;
}
Here is a method i am trying to call it in:
public void fillRowData(long Id) {
Cursor cursor = adapter.retrieveRow(id);
startManagingCursor(cursor);
String[] from = new String[]{DBAdapter.TITLE, DBAdapter.DATE, DBAdapter.TIME};
int[] to = new int[]{R.id.Name, R.id.Date, R.id.Time};
customCursor items = new customCursor(this, R.layout.viewlist, cursor, from, to);
setListAdapter(items);
}