I hope to set single TextView with two different colored text, I have the read the document
Single TextView with multiple colored text
Code A works well!
Code B get string from resource file, but the color of font can not be displayed, why?
Code A
TextView my=(TextView) findViewById(R.id.tVTitleOld);
String text = "<font color='#cc0029'>Hello</font> the <font color='#ffcc00'>world</font>";
my.setText(Html.fromHtml(text));
Code B
TextView my=(TextView) findViewById(R.id.tVTitleOld);
String text = getResources().getString(R.string.TitleOld);
my.setText(Html.fromHtml(text));
<string name="TitleOld"><font color='#cc0029'>Hello</font> the new <font color='#ffcc00'>world</font></string>