Hi guys,
I'm facing a problem with the result returned by list view's
getCheckedItemPositions() method. This is the scenario:

-I'm using a list view in multiple choice mode (list view with checkboxes) -
the idea being that a user can select several items and delete them at once.
-When the user clicks on the "delete" button, i use list view's
getCheckedItemPositions() method to retrieve the checked item positions and
i proceed to delete the items.
-This is the "tricky" part: i begin by checking the number of times i have
to delete eg. if the user has checked 3  items, then i'll delete 3 times.
- Each time i delete an item, i retrieve the checked item positions -
because after every delete the state of the list changes...
So what do i expect when i call getCheckedItemPositions() after deleting an
item ? i expect the checked item position keys to change to reflect the
state of the list... if i'm not wrong

eg.
- i have a list with 6 items [a, b, c, d, e, f], and the user checks d, e
and f , keys 3, 4 and 5 of the checked item positions list will be true - OK
- in code, i remove item  d at  position 3 of my list  using the adapter so
my list is now  [a, b, c, e, f]  -  at this point i do
myList.getCheckedItemPositions() expecting the returned sparse array to be
true for keys 3 & 4 - but this is not the case , instead the checked items
are exactly the same as those of the list before deleting any item.

I could be missing something here - could someone please clarify this.. ?
Thanks in advance,

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