Skip to content
Advertisement

How to change a backgound of a button in recyclerview [closed]

I made a recyclerview and there is a button on myitem. I want to change its color when I click it. How can I do that?

This is my adapter code:

JavaScript

Advertisement

Answer

listViewHolder.button.setBackgroundColor(ContextCompat.getColor(context, R.color.color_name));

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement