title: Android Spannablecontent With Rounded Corners
body: <p>I am trying to change my string to make a badge with a number in the middle by using Spannable String.  I can highlight the appropriate letter/number by setting the BackGroundColorSpan, but need help making it a little prettier.  I was hoping to have rounded corners with a little bit of padding around the entire shape.</p>
  <p>This article is really close to what I'm trying to do: <a href="https://stackoverflow.com/questions/19292838/android-spannablestring-set-background-behind-part-of-text">Android SpannableString set background behind part of text</a></p>
  <p>I really need to keep the resource as a TextView due to the way it interacts with my application.</p>
  <p>Any ideas how to utilize ReplacementSpan for my particular situation?</p>
  <p>Here is my code snippet:</p>
  <pre class="lang-java prettyprint-override"><code>if (menuItem.getMenuItemType() == SlidingMenuItem.MenuItemType.NOTIFICATIONS) {
      myMenuRow.setTypeface(null, Typeface.NORMAL);
      myMenuRow.setTextColor(getContext().getResources().getColor(R.color.BLACK));
      myMenuRow.setActivated(false);
      SpannableString spannablecontent = new SpannableString(myMenuRow.getText());
      spannablecontent.setSpan(new BackgroundColorSpan(Color.argb(150,0,0,0)), 18, myMenuRow.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
      myMenuRow.setText(spannablecontent);
  }
  </code></pre>