I defined a white color in mycolors.xml under res/values as below:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="my_white">#ffffffff</color>
</resources>
In my code, I set the text color of a TextView as the white color I defined:
TextView myText = (TextView) findViewById(R.id.my_text);
myText.setTextColor(R.color.my_white);
But the text in the TextView turned out to be a black color.
When I use @color/my_white in layout xml files, it works fine.
I check the generate R.java, and see:
public static final int my_white=0x7f070025;
Did I miss something?
Thanks.