android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0

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 stackoverflow.com by Unknown author

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

,
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) ...

Solutions on the web

via GitHub by kordianbruck
, 2 years ago
Index 0 requested, with a size of 0
via GitHub by kordianbruck
, 2 years ago
Index 0 requested, with a size of 0
via Stack Overflow by dhali
, 2 years ago
Index -1 requested, with a size of 0
via Stack Overflow by Khaled Mohamed
, 2 years ago
Index -1 requested, with a size of 1
android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:424)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
at de.tum.in.tumcampus.models.managers.CafeteriaManager.onRequestCard(CafeteriaManager.java:184)
at de.tum.in.tumcampus.models.managers.CardManager.update(CardManager.java:49)
at de.tum.in.tumcampus.activities.StartupActivity$BootTask.doInBackground(StartupActivity.java:67)
at de.tum.in.tumcampus.activities.StartupActivity$BootTask.doInBackground(StartupActivity.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
52 more bugmates

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