M
MSeiz5
Neues Mitglied
- 9
Weiss einer warum das nicht geht?
Fehlermeldung: Errormessage: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1
Code:
public void onListItemClick(
ListView parent, View v,
int position, long id)
{
open_database_rw();
Cursor cursor = db.query("tbl_homework", new String[] {"hw"},
"_id = 1", null, null, null, null);
int column = cursor.getColumnIndex("hw");
String item = cursor.getString(column);
Toast.makeText(this, item, Toast.LENGTH_SHORT).show();
}
Fehlermeldung: Errormessage: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1