Tuesday, May 21, 2013

Re: [android-developers] ListView with "selected" state does not work when list item view has a background

Hi Kostya!

On Tue, May 21, 2013 at 8:37 PM, Kostya Vasilyev <kmansoft@gmail.com> wrote:
> I call setChecked directly, because my "checkbox" tracking is in the same
> layout (although it's not a checkbox)
>
> To track selected items (for getView to do the right thing during scrolling,
> and to know what items user actions apply to), I'm using a
> LongSparseArray... Don't think it matters much (except ListView tracks
> checked items by position, whereas I prefer "stable" database IDs).

In the end, I went with CheckableLinearLayout, implemented
state_checked for it and wired it with an adapter. It works well so
far.

Regards,
Miha.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment