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.
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!
On Google Edition HTC One, the AlphabetIndexer sample crashes the first time it is opened:
Not sure this is the best way to fix it but it did stop the crash.