Hi,
Sorry, I don't have time to look up the links for you, but search this
group for getItemViewType and getViewTypeCount. There was a thread in
the last week that had a couple of very good links explaining exactly
what you want to do. I'm pretty sure the message you want was from Mark
Murphy.
On 16/06/2010 8:33 AM, sasq wrote:
I've been looking around a lot on how to separate a ListView into
sections with headers, and all solutions are based on using multiple
adapters.
I have only a single database query that is ordered by a specific
field. I want to present this information in a ListView, and insert
headings whenever the field changes.
For instance, you search a large amount of music files for "love" and
get a list like this:
== Alice Bung ==
Love boat
=== Beavers ===
Lots of Love
No Love
Zlovek Zlatan
=== Some other Group ==
Another song about love
Yet another song about love
Actually inserting the headers as a second viewtype requires you to
scan the whole result to get an accurate count.
The best I've come up with is returning the Header combined with the
first item as a single view so as to keep the count correct, but then
selection looks wrong.
Any tips?
-- Jonas
--
Sincerely,
Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://www.bgies.com
http://www.bistroblurb.com
http://www.bistrobot.com
-----------------------------------------------------------------------
Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en