I want to create Category items based listview using SectionIndexer where data coming from ContentProvider. I have found some examples where they are setting data from cursor to HashMap or TreeMap. But its not a good way to use cursor. I wonder if there is a way to use cursor in sectionindexer without any collection.
I want to create Category items based listview using SectionIndexer where data coming from
Share
AlphabetIndexer is what you need. It’ll do all the work for you.
EDIT: For the CharSequence, use ” ABCDEFGHIJKLMNOPQRSTUVWXYZ”. The ” ” at the beginning of the char sequence is needed.
EDIT: Here’s the source code for AlphabetIndexer. Try customizing that to return the Section name instead of the alphabet.