Android Utililty Methods SpannableString Create

List of utility methods to do SpannableString Create


The list of methods to do SpannableString Create are organized into topic(s).


SpannableStringgetSpanableText(String wholeText, String spanableText)
get Spanable Text
if (TextUtils.isEmpty(wholeText))
    wholeText = "";
SpannableString spannableString = new SpannableString(wholeText);
if (spanableText.equals(""))
    return spannableString;
wholeText = wholeText.toLowerCase();
spanableText = spanableText.toLowerCase();
int startPos = wholeText.indexOf(spanableText);
SpannablemakeColoredString(String text, int color)
make Colored String
Spannable result = new SpannableString(text);
result.setSpan(new ForegroundColorSpan(color), 0, text.length(),
return result;