0

I solved it like this, do you think it is correct?

 getColor(int id, Theme theme);

`getColor(R.color.green, getContext().getTheme());`

where "green" is in resources / colors:

`color name="green">#ff00ff00</color>`
marioc
  • 1
  • 1

1 Answers1

2

Use ContextCompat.getColor(context, R.color.colorName) As this answer shows: getResources().getColor() is deprecated

FalcoVerhagen
  • 69
  • 1
  • 7