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>`
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>`
Use ContextCompat.getColor(context, R.color.colorName)
As this answer shows: getResources().getColor() is deprecated