java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lenovo.finalproject/com.example.lenovo.finalproject.MainActivity5}: 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 Stack Overflow by Subhendu Roy
, 1 year ago
Unable to start activity ComponentInfo{com.example.lenovo.finalproject/com.example.lenovo.finalproject.MainActivity5}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
via Stack Overflow by Saad
, 2 years ago
Unable to start activity ComponentInfo{com.example.socialize_us/com.example.socialize_us.PhoneBookActivity}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
via Stack Overflow by MOS182
, 2 years ago
Unable to start activity ComponentInfo{com.studentbudget/com.studentbudget.Reminders}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
via Stack Overflow by Eduardo Gutiérrez
, 2 years ago
Unable to start activity ComponentInfo{com.example.informacion/com.example.informacion.MainActivity}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
via Stack Overflow by new
, 2 years ago
Unable to start activity ComponentInfo{com.android.MyDoc/com.android.MyDoc.MedicineDetail}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
via Stack Overflow by Papajohn000
, 2 years ago
Unable to start activity ComponentInfo{com.example.camerapreview/com.example.camerapreview.Gridview}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
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 com.example.lenovo.finalproject.MainActivity5.initListViewData(MainActivity5.java:90)
at com.example.lenovo.finalproject.MainActivity5.onCreate(MainActivity5.java:69)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)

Users with the same issue

21 times, 3 months ago
9 times, 10 months ago
Once, 11 months ago
Once, 1 year ago
16 times, 1 year ago

Write tip

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