E/AndroidRuntime(10638): android.database.CursorIndexOutOfBoundsException: Index 133 requested, with a size of 133
E/AndroidRuntime(10638): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426)
E/AndroidRuntime(10638): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
E/AndroidRuntime(10638): at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:74)
E/AndroidRuntime(10638): at android.database.CursorWrapper.getLong(CursorWrapper.java:106)
E/AndroidRuntime(10638): at android.database.CursorWrapper.getLong(CursorWrapper.java:106)
E/AndroidRuntime(10638): at com.android.email.activity.MessagesAdapter.isNoResultView(MessagesAdapter.java:375)
E/AndroidRuntime(10638): at com.android.email.activity.MessagesAdapter.getItemViewType(MessagesAdapter.java:443)
E/AndroidRuntime(10638): at android.widget.HeaderViewListAdapter.getItemViewType(HeaderViewListAdapter.java:234)
The weird thing is that in getItemViewType
, we get the cursor using moveToPosition(int pos)
. That means it's guaranteed that the cursor is not out of bounds. Is it possible that cursor is swapped when we try to get access to it? If so, how should I block the cursor?
its hard to say without viewing the code just based on logcat but the error comes when you try to access a column which does not exists...
confirm if the column count and names matches your expectation.
you might have changed the db without changing the version etc. so i wud suggest to be on safer side you can uninstall the app change the DB name in the code and install it back see if it reproduces the error...
hope it helps.... thx