My users are sending unhandled exceptions to me via http://code.google.com/p/android-remote-stacktrace/
I am getting the following but have no idea what it means.
Its Late but yesterday i figure out this problem. The Problem is in your case is your end is before start like 7....0 which is wrong if you want to highlight a text you start should be less then your end. Check out posted example its perfectly working.
The Answer is for those Who still has this issue.
String searchText = "Your search String";
String qr_code = "Your String";
int length = searchText.length();
if (length > 0) {
//color your text here
int index = qr_code.indexOf(searchText);
SpannableString sb = new SpannableString(qr_code);
ForegroundColorSpan fcs = new ForegroundColorSpan(getResources().getColor(R.color.colorAccent));
sb.setSpan(fcs, index, (index+length), Spanned.SPAN_EXCLUSIVE_INCLUSIVE)
holder.textViewShortCode.setText(sb);
} else {
textViewShortCode.setText(Html.fromHtml(qr_code));
}