Why doesn't my text show up with style when using SpannableStringBuilder?
问题 I have a problem with a SpannableString object. Below's a short example: SpannableString spanstr = new SpannableString("Bold please!"); spanstr.setSpan(new StyleSpan(Typeface.BOLD), 0, spanstr.length(), 0); SpannableStringBuilder sb = new SpannableStringBuilder(); sb.append(spanstr); sb.append("\n"); // A newline sb.append("The first line is bold. This one isn't."); CharSequence cq = sb.subSequence(0, sb.length()); // ^There's no such method to return a SpannableString, // so I try to return