How to access all Recyclerview Viewholder class variable in another Adapter class in android studio

81 Views Asked by At

My question is how to unmark favorite icon/update button background in adapter after removing item from favorite activity in android studio

1

There are 1 best solutions below

0
jcredking On

If You Want to Add and Remove Favorite items then you need to create a favorite value in your database.

And get favorite value and check it in onBindViewHolder like

if(isFavorite){
//set favorite icon
    } else {
//set Unfavorite icon
}

After that, you no need to access variables.