Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when first loading AlphabetIndexer sample #11

Merged
merged 1 commit into from
Jul 13, 2013
Merged

Fix crash when first loading AlphabetIndexer sample #11

merged 1 commit into from
Jul 13, 2013

Conversation

intrications
Copy link
Contributor

On Google Edition HTC One, the AlphabetIndexer sample crashes the first time it is opened:

    E  android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
                    E   at android.database.AbstractCursor.checkPosition(AbstractCursor.java:430)
                    E   at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
                    E   at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
                    E   at android.database.CursorWrapper.getString(CursorWrapper.java:118)
                    E   at android.widget.AlphabetIndexer.getSectionForPosition(AlphabetIndexer.java:258)
                    E   at com.manuelpeinado.multichoiceadapter.demo.alphabetindexersample.AlphabetIndexerCursorAdapter.getSectionForPosition(AlphabetIndexerCursorAdapter.j
                       ava:93)
                    E   at android.widget.FastScroller.getThumbPositionForListPosition(FastScroller.java:647)
                    E   at android.widget.FastScroller.onScroll(FastScroller.java:457)
                    E   at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:1452)
                    [.....]

Not sure this is the best way to fix it but it did stop the crash.

ManuelPeinado added a commit that referenced this pull request Jul 13, 2013
Fix crash when first loading AlphabetIndexer sample
@ManuelPeinado ManuelPeinado merged commit b0a698a into ManuelPeinado:master Jul 13, 2013
@ManuelPeinado
Copy link
Owner

There is something weird going on with the content provider / loader. I'm not sure what it is, but your change set does indeed provide a workaround. Thanks a lot!

@intrications intrications deleted the fix-alphabet-crash branch July 13, 2013 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants