I'm using a ListView
which has:
- list item click
CheckBox
click
I can save the cursorPosition by using view.setTag(cursor.getPosition())
and I can take necessary action on the checked item but when I scroll down, I see several other CheckBoxes
checked(visual only).
As a work around I tried setting the view description, saving CheckedBox
view ids in list and then iterate to see if CheckBox
needs to be shown as checked. But views appear to be reused as I scroll down(same view ids).
How can I only show the actual checked CheckBoxes
? Code:
public class MyViewBinder implements ViewBinder {
public boolean setViewValue(View view, final Cursor cursor, int columnIndex) {
int viewId = view.getId();
switch (viewId) {
case R.id.checkbox:
view.setTag(cursor.getPosition());
return true;
case R.id.....
.......
}
Used as:
mySimpleCursorAdapter.setViewBinder(myViewBinder);