I have a custom listview adapter with a imageview, textview and a checkbox. and i also have a button and a checkbox in my main layout(not in listview).
What here i want
Yeah, this recycling is a pain.
Here's what I did: http://dev.kafol.net/2011/11/android-checkbox-listview-un-check-all.html
I'm still having some issues with SharedPreferences, as allthough I have managed to get all the checkboxes checked or unchecked, it still doesn't save the state to sharedpreferences.
This morning I read an answer of an issue like this, and they recommend we put holder.checkBox.setChecked(itemChecked.get(position));
before holder.checkBox.setOnCheckedChangeListener
So, getView
function will be rewritten like this:
public View getView(....)
{
...
holder.checkBox.setChecked(itemChecked.get(position));///move to here
holder.checkBox.setOnCheckedChangeListener(...);
...
)