I am having custom listview(with image, text and check box) and a button(named Done) in my listactivity.
I am able to check/un check check box upon list item click event by implementing listvw.setOnItemClickListener().
Now when i click Done button, I want to know how many list items are checked. How to do that?
Why don’t you track that on your
setOnItemClickListenerimplementation? Something like this will work:In the case above, you just have to use the
countvariable from your click listener of the DoneButton. Of course, this will work fine if all theCheckboxesare unchecked when the Activity starts.