Most efficient way for Dynamic Text Color Change in TextView
问题 I want to change color of parts of a text several times with a timer. Simplest way is this: SpannableStringBuilder ssb = new SpannableStringBuilder(mainText); ForegroundColorSpan span = new ForegroundColorSpan(Color.BLUE); ssb.setSpan(span, start, end, 0); tv.setText(ssb); But if I run the above code several times in a second, I actually change the whole (large) text of TextView each time so a unwanted memory-CPU load will happen specifically on lower-end devices. How can I have a single Span