Skip to content Skip to sidebar Skip to footer

Android Sqlite Db.query Leads To Cursorindexoutofboundsexception

I am trying to select certain rows from my database, but since I kept getting index out of bound I decided to remove the WHERE part for now and just get all of the data. I have use

Solution 1:

Your cursor is empty if it didn't move.

try

if (c.moveToFirst()) {
    String test= c.getString(0);
    // or String test= c.getString(c.getColumnIndex("column_name")); 
}

Post a Comment for "Android Sqlite Db.query Leads To Cursorindexoutofboundsexception"