ManuelPeinado / MultiChoiceAdapter

Android - A ListView adapter with support for multiple choice modal selection
Apache License 2.0
849 stars 260 forks source link

Items get deselected when list scrolls off-screen #5

Closed zipgenius closed 11 years ago

zipgenius commented 11 years ago

In order to reproduce the issue: add LOTS of items to the arrays in arrays.xml file of the sample application. Run the BaseAdapterDemo and select 3 or 4 items in list. Then scroll down until selected items go off-screen: you will see the selected items count decrease until the ActionBar gose back to non-contextual mode and items are not selected anymore.

ManuelPeinado commented 11 years ago

Good catch, I'll look into it!

ManuelPeinado commented 11 years ago

Interesting, it only seems to happen when the list has checkboxes. Let's keep investigating

ManuelPeinado commented 11 years ago

Fixed on 2.1.2. Code already in the github repo, artifacts should be in maven central in a couple hours.

fedefernandez commented 11 years ago

I'm still having problems with this bug. I think you need to call setTag before setChecked in MultiChoiceAdapterHelper.initItemCheckBox method because in recycled views setChecked will trigger onCheckedChanged method with an old tag value.

ManuelPeinado commented 11 years ago

@projectsexception I've switched the calls to setTag and setChecked as you suggest (v2.2.4)