I've seen this problem talked about before on the group, but the
general fix seems to be to use a table that has a primary key field
named "_id". This field is present in my table, yet I still get this
exception. However, I only get this exception when I attempt to use
the getColumnIndex method of the Cursor. If I dont use that method,
everything works fine.
Anyone have any idea what is causing this? Here is the relevant code:
public ArrayList<String> getSetting(String family, String type){
SQLiteDatabase db = getWritableDatabase();
Cursor cursor = db.rawQuery("select * from " +
SettingsTable.TABLE_NAME + " where " + SettingsTable.FAMILY + "='" +
family + "' and " + SettingsTable.TYPE + "='" + type + "'", null);
ArrayList<String> list = new ArrayList<String>(cursor.getCount
());
while(cursor.moveToNext()){
String value = cursor.getString(cursor.getColumnIndex
(CourseTable.VISIBLE));
list.add(value);
}
cursor.close();
return list;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---