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 Stack Overflow by Rejinderi

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

Solutions on the web

via educity.cn by Unknown author, 1 year ago
via GitHub by VDK
, 1 year ago
Index 0 requested, with a size of 0
via Stack Overflow by user1637466
, 2 years ago
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)

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.