I have a multiple choice listview where I'm trying to implement
"Select All" and "Select None" buttons. What I'm doing is moving the
cursor to the first row, then going through the list one by one and
setting the item as checked. As soon as I set the item as checked
(true or false), the list cursor gets reset back to the first item in
the list.
This code becomes an infinite loop because it keeps resetting back to
item 0 every time:
mListCursor.moveToFirst();
ListView list = getListView();
do
{
list.setItemChecked(mListCursor.getPosition(), true);
} while(mListCursor.moveToNext());
I've added some code to save the position before calling
setItemChecked and then moving the cursor to that position afterward
and that fixes the problem.
Can anyone tell me if I'm doing something wrong? Should I be doing
this a different way?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---