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

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.

Stack trace

  • android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580) at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214) at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:84) at com.eastcom.intelligentanswer.dao.DialectDao.getAllDialect(DialectDao.java:71) at com.eastcom.intelligentanswer.ui.Scenese.onClick(Scenese.java:305) at android.view.View.performClick(View.java:2538) at android.view.View$PerformClick.run(View.java:9152) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3691) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) at dalvik.system.NativeStart.main(Native Method)

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

Unknown visitor
Unknown visitorOnce,
Ranjana DangolRanjana Dangol
2 times, last one
bayukresnobayukresno
2 times, last one
nageshnagesh
Once,
Unknown visitor
Unknown visitorOnce,
51 more bugmates