Puede concatenar dos o más tramos. De esta forma es más fácil colorear texto dinámico utilizando el valor de longitud.
SpannableStringBuilder span1 = new SpannableStringBuilder("Android");
ForegroundColorSpan color1=new ForegroundColorSpan(getResources().getColor(R.color.colorPrimary));
span1.setSpan(color1, 0, span1.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
SpannableStringBuilder span2 = new SpannableStringBuilder("Love");
ForegroundColorSpan color2=new ForegroundColorSpan(getResources().getColor(R.color.colorSecondary));
span2.setSpan(color2, 0, span2.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
Spanned concatenated=(Spanned) TextUtils.concat(span1," => ",span2);
SpannableStringBuilder result = new SpannableStringBuilder(concatenated);
TextView tv = (TextView) rootView.findViewById(R.id.my_texview);
tv.setText(result, TextView.BufferType.SPANNABLE);
posible duplicado de [¿cómo puedo cambiar parte de color de una TextView?] (Http://stackoverflow.com/questions/4032676/ how-can-i-change-color-part-of-a-textview) –
Si hay un texto largo en TextView, hay [una forma más eficiente] (http://stackoverflow.com/a/34449956/ 3414180) – Mingfei
Posible duplicado de [Set color del lapso de TextView en Android] (http://stackoverflow.com/questions/3282940/set-color-of-textview-span-in-android) – Suragch