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

When you get a Cursor returned from the database you should do an moveToFirst(); before trying to get data from it.

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

Solutions on the web371

  • Stack trace

    • android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 at android.database.AbstractCursor.checkPosition( at android.database.AbstractWindowedCursor.checkPosition( at android.database.AbstractWindowedCursor.getString( at android.database.CursorWrapper.getString( at org.kontalk.ui.ComposeMessageFragment.onActivityResult( at at org.kontalk.ui.ComposeMessage.onActivityResult( at at at at$1300( at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invokeNative( at java.lang.reflect.Method.invoke( at$ at at dalvik.system.NativeStart.main(

    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

    11 times, last one
    Indri YunitaIndri Yunita
    3 times, last one
    8 times, last one
    52 more bugmates