How to have a SpannableStringBuilder append a span that's inside a formatted string?
问题 Background Suppose I use SpannableStringBuilder to append multiple stuff into it, and one of them is string that I format from the strings.xml file, which has a span inside: SpannableStringBuilder stringBuilder = new SpannableStringBuilder (); stringBuilder.append(...)... final SpannableString span = new SpannableString(...); span.setSpan(new BackgroundColorSpan(0xff990000), ...,...,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); stringBuilder.append(getString(R.string.string_to_format, span));