Explain me the usage of getPositionForSection(int) and getSectionForPosition(int) and getSections() methods of ArrayAdapter?
I got a good explanation of getViewTypeCount and getItemViewType methods of ArrayAdapter.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here
Create a new AlphabetIndexer
getSections() retreives the String[] of the alphabets that is provided to the alphabetIndexer
alphabetIndexer.getSectionForPosition(position) retreives the section for the current position
Consider the given case
To get the section for the position
alphabetIndexer.getPositionForSection(section) retreives the first position at which the data starts with that section
Hope this helps you.
An example of using alphabetIndexer
To use this just create a new class extends SectionedListAdapter and then provide required details.