Skip to content
Advertisement

Java – getCardBackgroundColor – color for CardView

Can you help me with my code? I am changing the color of the item based on the information from the database, and now I wanted to transfer the color to the CardView, but I don’t know what the notation should look like, because this code tells me that the Color.RED write is wrong. Will you help me?

JavaScript

Advertisement

Answer

You have to use setCardBackgroundColor not getCardBackgroundColor. Then your code should be:

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