James Do

Greenhorn
+ Follow
since Sep 24, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by James Do

do you have any sample code?
11 years ago
these scrolling view reuse Views rather than continuing to create a new one for every item in the list (or grid)
Therefore if your device is able to fit 15 items on the screen, you will only be asked to create 15 views. If you scroll up so that the top row disappears, those Views will be reused on the bottom row rather than requiring new Views to be created.

Coming back to your code, it should now be obvious that you set the checked state when the View is created, but not when it is reused.
Rather than relying on the View to maintain the checked state you should have a custom object associated with the current view and update the custom object when the check state changes.
11 years ago