[Solved] Why does R.color.myColor return wrong color and getColor() return correct?


R.color.myColor isn’t the actual color code. It’s a resource id that can be used to look up the color code via getColor. The reason for this is that the actual color of the resource can change based on theme, locale, or a dozen other options if you want it to. So if you need the actual color code, call getColor.

0

solved Why does R.color.myColor return wrong color and getColor() return correct?