i want to show a listview with check box like
checkbox listitem1
checkbox listitem2
checkbox listitem3
.
I have the same problem. i have just fixed it 2 days before:
In the : public View getView
cb =(CheckBox)row.findViewById(R.id.CheckBox01);
cb.setChecked(etat[position]);
final int xt=position;
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
if(arg0.isChecked())
{
etat[xt]=true;
//Update the state of Checkbox to the: "tabEtat"
Etat.getInstance().setAddIdEtat(String.valueOf(xt));
}
}
else
{
//Update the state of Checkbox to the : "tabEtat"
Etat.getInstance().setDeleteIdEtat(String.valueOf(xt));
}
}
}
});