I mean something like:
Error!
Put this code in the string.xml
file:
<font color="Red"><a href="support@legacystories.org">HERE</a></font>
No this is not possible you have to specify that in your layout. But you can put the color in your colors.xml.
colors.xml
<color name="foo">#abc123</color>
your_layout.xml
<TextView android:textColor="@color/foo" android:text="@string/error" />
Strings.xml
<string name="pbs_setup_title">Select %1$s <font fgcolor="#FF33B5E5">brand</font> or scan the <font fgcolor="#FFFF0000">Remote</font></string>
class.java
String SelectedDeviceType_Str = "TV"
SetupYourDevice_TextView.setText(Html.fromHtml(String.format(Html.toHtml(new SpannedString(getResources().getText(R.string.pbs_setup_title))),
SelectedDeviceType_Str)));
As suggested by rekire not possible to set color the way you are doing.
You can use the method as suggested by rekire.
In you xml you can specify color for your textview as
android:textColor="#0EFFFF"
You can also set text color programaticaly
TextView tv= (TextView)findviewById(R.id.textView1);
tv.setTextColor(Color.RED);
To set color of particular words in textview, you can use spannable string
TextView tv= (TextView)findviewById(R.id.textView1);
tv.setText("");
String s="Hello World";
SpannableString ss= new SpannableString(s);
ss.setSpan(new ForegroundColorSpan(Color.GREEN), 0, 5, 0);
tv.setText(ss);
Try this one
<string name="some_text">Font color is <font fgcolor="#ffff0000">red</font></string>
In Strings.xml:
<resources>
<color name="etDisabled">#ac8888</color>
<color name="myorange">#f56415</color>
<color name="mygreen">#95cd08</color>
</resources>
Then in the code:
TextView myText = (TextView) findViewById(R.id.tvJugador1);
myText.setTextColor(R.color.mygreen);