Skip to content Skip to sidebar Skip to footer

Recyclerview With Two Checkbox (yes Or No) In Android

How to get the position of particular checkbox(yes or no) in each row of a recycler view I am able to get the position of row wise checkbox but on scrolling both (yes and no) check

Solution 1:

Maintain a model for the current status, for example -

classMyModel{
    String status;
    boolean isChecked;
}

Now tag position with every checkbox, in onBind. So whenever you getChangeListner just change in model. Also bind checkbox as per model flag value.

Hope it will help, let me know if you need further help :)

Solution 2:

See this answer you can go with two Boolean variable and instead od visibility use setchecked(true/false)

Solution 3:

You can use a SparseArray to record which one you have already checked.

Post a Comment for "Recyclerview With Two Checkbox (yes Or No) In Android"