I want to change color of parts of a text several times with a timer.
Simplest way is this:
SpannableStringBuilder ssb = new SpannableStringBuilder(m
I meet the same issue this afternoon,and here is my solution:
tv.setText(yourText, TextView.BufferType.SPANNABLE);
ForegroundColorSpan span = new ForegroundColorSpan(Color.BLUE);
((Spannable) article.getText()).setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
I found it's a much more efficient way,in my project I used set-whole-text method took 400~600 milliseconds,by this way only 0 or 1 millisecond.