Android examples for android.text:SpannableString
append Bold to SpannableStringBuilder
import android.graphics.Typeface; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.style.StyleSpan; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; public class Main{ public static void appendBold(SpannableStringBuilder sb, String boldText) { sb.append(boldText);/*from w w w. jav a2 s . c o m*/ sb.setSpan(new StyleSpan(Typeface.BOLD), sb.length() - boldText.length(), sb.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } }