I have a ListView with a TextView and a Checkbox on every row. I’m trying to create a sequence where the user has to click on the Checkbox of the first row to enable the next row and remove a grayed out effect. Clicking on the Checkbox in this row will do the same to the next row and so on.
Is this possible? and how?
Create a custom
Objectto keep the state of your row. For example:Inside your
Activityyou make anArrayList<Row>()and give it as source to theAdapterof yourListView.The
Adapterfor yourListViewis custom. You can follow the example found here. In your case some adjustments will be as followed:Now we have a
Listview, aCustomAdapterand for each item in the list we have anRowwhich provides a certain state. Default all the states will be set to gray-state except the first item. Using theonItemClickedListener, we can unlock other items..Good luck!