ListView.getCheckedItemPositions() will give you the list of all
checked items, identified by their adapter's position.
On Fri, Oct 17, 2008 at 10:05 PM, kelly <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a multi-select ListActivity, and I'd like to programmatically
> detect which of the items are selected. I tried implementing
> OnListItemClick(), and doing this:
>
> if(v instanceof CheckedTextView)
> {
> boolean selected = ((CheckedTextView)v).isChecked();
> if(selected)
> {
> // item is checked
> }
> }
>
> The problem is, "checked" above is always the opposite of the state of
> the item. E.g. if I select an item in the list (thereby checking it),
> the isChecked() method returns false. The next time I click, the
> isChecked() method for the CheckedTextView returns true. So I'm
> essentially getting the click event before the state of the item
> changes.
>
> I'm sure I'm doing this wrong, so I'd appreciate any insights.
>
> Thanks
>
> >
>
--
Romain Guy
www.curious-creature.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---