No need for HTML, just use spans.
Spannable text = new SpannableString("hello");
text.setSpan(new ForegroundColorSpan(Color.RED), 0, text.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
mTextView.setText(text);
If you’re using appcompat, you probably want to new AppCompatTextView(context)
rather than just new TextView(context)
.
CLICK HERE to find out more related problems solutions.