Android SQLite data display to ListView

The Cursor must include a column named “_id” or this class (CursorAdapter and descendants) will not work.

COL_ID should be “_id” or you can try to use a workaround by making alias:

String[] allColumns = new String[] { SqlDbHelper.COL_ID + " AS " + BaseColumns._ID, ...

See CursorAdapter

Browse More Popular Posts

Leave a Comment