I have a listview that contains a checkedtextview. My app moves from the top of the list view to the bottom. I want to check if the item is checked before calling an action. If it is not checked I want to move to the next item in the list.
E.g.
Item 1 – Checked
item 2 – Checked
Item 3 – Not Checked
Item 4 – Checked
So, I want the app to process as follows:
Item 1
Item 2
Item 4.
I am not sure how to access the checked status of the item from the listview position.
The logic that I want is as follows:
Is Current Item checked?
Yes:
Call action
No:
Move to next item.
Reloop to top of void.
I will need something in there to stop an infinite loop.
One solution will be to use an
ArrayListof positions.When the user check/uncheck a
checkbox, add/remove accordingly the position in yourArrayList.Then when the user is over, just iterate through the list to know which position have been selected.