View As Android Contact Screen
I am developing an application with a lot of items that need to be ordered alphabetically and I would like it to look the same as the Android contact list, this is
[Letter]
<contact>
<contact>
[Letter]
<contact>
<contact>
<contact>
and etc.
What's the best way to achieve this same layout? I've seen several tutorials on scrollable lists, but this is a little different. I've searched the Android source code a bit, but if anyone has an answer, it will save me a lot of time.
Thanks in advance.
a source to share
You can use mine MergeAdapter
to do this, either directly or as a base to create your own adapter that gives you the look you want.
In short, you need to create ListAdapter
one that handles both your contacts and your headers. You will most likely end up using different views for those you are most likely to and the methods you override on ListAdapter
for each Android. You can also say that headers are not included, which means they will not respond to select or click events.
a source to share