I know this is covered often, but I cant find the mistake.
public Integer getMaxId() {
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery("SELECT MAX(LINE) FROM datab_table", null);
if (cursor != null && cursor.moveToFirst()) {
id = cursor.getInt(0);
cursor.close();
}
return id;
}
I get this error:
android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
Aucun commentaire:
Enregistrer un commentaire