¡@

Home 

java Programming Glossary: foregroundcolorspan

How to use SpannableString with Regex in android?

http://stackoverflow.com/questions/7364119/how-to-use-spannablestring-with-regex-in-android

replace new SpannableString find replace.setSpan new ForegroundColorSpan Color.RED 0 1 Spannable.SPAN_INCLUSIVE_INCLUSIVE String output.. while true startSpan vString.indexOf target endSpan ForegroundColorSpan foreColour new ForegroundColorSpan colour Need a NEW span object.. target endSpan ForegroundColorSpan foreColour new ForegroundColorSpan colour Need a NEW span object every loop else it just moves..

Is it possible to change the text color in a string to multiple colors in Java?

http://stackoverflow.com/questions/8405661/is-it-possible-to-change-the-text-color-in-a-string-to-multiple-colors-in-java

its possible. For this you need to use SpannableString and ForegroundColorSpan . This should look something like this SpannableStringBuilder.. new SpannableString red redSpannable.setSpan new ForegroundColorSpan Color.RED 0 red.length 0 builder.append redSpannable String.. new SpannableString white whiteSpannable.setSpan new ForegroundColorSpan Color.WHITE 0 white.length 0 builder.append whiteSpannable String..