What I have: I have a ListView with custom rows, having a CheckBox & two TextViews in each row. I have a button for \"Select All\".
What i
It will occur, because ListView adapter reuses views. The way you are trying to do is incorrect. I don't think you ever should access listview rows through listview children.
Introduce a variable in your activity, that will hold the current state (boolean checkAll
). When the user presses the button, it must set "checkAll" to true, and call notifyDataSetChanged()
(for arrayadapter), or requery()
(for cursoradapter) on your ListView's adapter. In adapter's getView()
method introduce a check for this flag, so if (checkAll) {check the check box}