Hi, In android there is A to Z selector on right side of the contacts. one can just select on of the alphabet and only those contacts will be displayed which are starting with that selected alphabet. I want to implement such kind of list.. !! Any idea ??
Here's the basic idea of what you'd need to do:
First you'll want to generate your alphabet list... you can either hard code this (Always showing A-Z) or you can try running a query from the database that will give you all of the display names, parsing the cursor to build a list of unique letters (only add a letter if its not in your list already).
After getting your list of characters you'll want to assign them to widget of your choice (either a container view with buttons or some kind of listview would work). Make sure to also have some kind of list for your contacts to be displayed in as well.
When responding to a click event of one of your letters, you'll want to run a query against the contacts database that adds something similar the following LIKE clause to your where string:
" substr(, 1,1) LIKE '%' "
The resulting data you then just need to display in your data list.
Good luck :)