I want to change color of parts of a text several times with a timer.
Simplest way is this:
SpannableStringBuilder ssb = new SpannableStringBuilder(m
execute below code once:
SpannableStringBuilder ssb = new SpannableStringBuilder(mainText); ForegroundColorSpan span = new ForegroundColorSpan(Color.BLUE);
and every time you want to change span do this:
ssb.clearSpans() ssb.setSpan(span, start, end, 0); tv.setText(ssb);