I think the cursor.moveToFirst()
has not been called so the cursor is throwing android.database.CursorIndexOutOfBoundsException.
Before using a cursor
you should always check is the cursor is empty or not by calling cursor.moveToFirst()
. This will also position the cursor at the first position.