android.database.CursorIndexOutOfBoundsException

Index 0 requested, with a size of 0

Samebug tips3

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

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


Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web402

  • Index 0 requested, with a size of 0
  • via Google Groups by 籐野リタ, 6 months ago
    Index 0 requested, with a size of 0
  • Index 0 requested, with a size of 0
  • Stack trace

    • android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426) at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136) at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50) at com.sohaib.dailyexpense.Database.doUpdateInc(Database.java:77) at com.sohaib.dailyexpense.Database.insertContact(Database.java:87)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    2 times, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    51 more bugmates