SpannableStringBuilder设置指定文字颜色:Java代码1Stringstr=Thereare36appsinyourphone.;2intindex=appNum.indexOf(apps);3SpannableStringBuilderss=newSpannableStringBuilder(str);4ForegroundColorSpanspan=newForegroundColorSpan(Color.parseColor(#F79719));5ss.setSpan(span,16,index,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);6textView.setText(ss)<span></span>Java代码7ss.setSpan(newBackgroundColorSpan(Color.RED...