Ok, so I had a cursor-based ListView laying around, and decided to try and practice what I preach :)

Got it working in just a few minutes, actually.

The second screenshot shows that there aren't any issues with trackpad based selection highlighting, at least on my Motorola Milestone.

To prevent clickable headers, I set an empty click listener just on the view that shows group data (the blue one).

No crashes, either - I scrolled up and down quite a bit.

http://img-fotki.yandex.ru/get/4700/kman.0/0_5bc24_c4d124db_L

http://img-fotki.yandex.ru/get/4400/kman.0/0_5bc25_20348bcf_L

-- Kostya

15.11.2010 18:50, Neilz пишет:
Interesting solution thanks , and I've kind of got it working very
quickly. Unfortunately the headers are still clickable when visible
(as they're part of a list item), so it's not as clean a solution as
the MergeAdapter - if I can get that working!

On Nov 15, 3:10 pm, Thierry Legras<[email protected]>  wrote:
Hi,

I found something that highlights Kostya solution including a trick to avoir
header to appear selected:

http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/

This seems straightforward to follow ... except that i can't get previous
record. Unfortunately the isHeaderVisible(Cursor) method is not given :(
I tried to use Cursor.moveToPrevious(), but that crashes on subsequent
setViewValue call. I guessed I should not modify cursor within
setViewValue() and try to restore cursor position before leaving the method,
but that still crashes.
Any clue?

Thierry.

2010/11/15 Neilz<[email protected]>


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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

Reply via email to