title: SpannableString.setSpan not working?
body: <p>I am trying to set different colors for </p>
  
  <pre><code>            str.append(" ").append(isBlue ? "b" : "p");
              SpannableString spannable = new SpannableString(str);
              spannable.setSpan(new ForegroundColorSpan(isBlue ? R.color.blue: R.color.pink),
                      spannable.length() - 1,
                      spannable.length(),
                      Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
              miscTextView.setText(spannable);
  </code></pre>
  
  <p><code>str</code> is an instance of <code>StringBuilder</code>.
  I am expecting the last character of <code>miscTextView</code> to be blue if <code>isBlue</code> is true, pink otherwise, while the rest of the text stays black.<br>
  But it turns out to be that Either case the last character is grey, which really confuses me. 
  What did I do wrong?</p>
  
  <p>Edit: I check the color resource xml already.Intellij shows the color on the left of xml code line.</p>