I'm trying to create a list adapter that pulls in and displays data from a database. From what I can tell, it is pulling in the info, but it fails when I try to create the ListAdapter from the new Simple cursor adapter. Not sure what I'm doing wrong here.
SQLiteDatabase db = myDbHelper.getReadableDatabase();
String select = "Select StateID, State, Details from States";
Cursor cursor = db.rawQuery(select, null);
startManagingCursor(cursor);
ListAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
cursor,
new String[]{"State"},
new int[]{android.R.id.text1});
setListAdapter(adapter);
Part two will be figuring out how to assign StateID as a row id in the list so that I can access it when someone clicks on a state, but so that it's not visible.