CardBackgroundColor remains Grey when I want to set a custom color, whereas default colors works fine.
For instance, Card.setCardBackgroundColor(R.color."customcolor") don't set the custom color. The color is grey, whereas Card.setCardBackgroundColor(Color.RED) works fine.
I have tried:
No results.
EDIT :
Card.setCardBackgroundColor(Color.parseColor("#FFFFFFFF")) works. But I have to hardcode the color. Any idea on a better way?
Heyy,
You have to get the color from the resources like this
Card.setCardBackgroundColor(getResources().getColor(R.color.'your color'));
Edit
As you are getting a context from your adapter, so
Card.setCardBackgroundColor(context.getResources().getColor(R.color.'your color'));
That works perfectly!!