android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 71

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via Stack Overflow by KristianMedK

You have an empty cursor. Check your query if it is not expected, or handle empty cursor with if(cursor.getCount() > 0) ...

,
via stackoverflow.com by Unknown author

You need to make sure that there is a data in the cursor. Check that moveToFirst() return true.

Solutions on the web

via Stack Overflow by DMC
, 2 years ago
via Stack Overflow by mol
, 2 years ago
Index 50 requested, with a size of 50
via Stack Overflow by Khaled Mohamed
, 2 years ago
Index -1 requested, with a size of 1
via Stack Overflow by mithil
, 2 years ago
via Stack Overflow by dhali
, 2 years ago
Index -1 requested, with a size of 0
via Stack Overflow by user3190959
, 2 years ago
Index -1 requested, with a size of 23
android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 71
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:400)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
at com.hmh.android.readers.MyReadersActivity$1.run(MyReadersActivity.java:940)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4533)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

Users with the same issue

21 times, 2 months ago
9 times, 9 months ago
Once, 10 months ago
Once, 10 months ago
16 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.