contents = "内容显示多种颜色";
SpannableStringBuilder style = new SpannableStringBuilder(contents);
//前面两个字为橙色
style.setSpan(new ForegroundColorSpan(context.getResources()
.getColor(R.color.organge)), 0, 2,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
//后面字为红色
style.setSpan(new ForegroundColorSpan(context.getResources()
.getColor(R.color.red)), 2, contents.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tvTest.setText(style);