In the string.xml file i use the following tag
<string name="CodeColor" >"#0000ff"</string>
If I use
textview1.setTextColor(Color.RED);
it works, but when I use
textview1.setTextColor(TextViewStyles.this.getResources().getColor(R.string.CodeColor));
or
textview1.setTextColor(R.string.CodeColor);
it doen’t work.
Any suggestions…
Thanks in Advance
You need to create a set of styles in your xml (regularly in res/values/styles.xml)
In the layout files you can call to the colors or styles:
Checkout some examples:
http://developer.android.com/guide/topics/ui/themes.html