title: How to detect if selected text is bold?
body: <p>I am creating a rich text box in Xamarin.Android. So far I can make the selected text into bold or italic text. However, now I want, when clicking on the bold button, then the selected text should turn back to normal. So my question is, how do I check if the selected text is bold?
     I have tried following way    </p>
  
  <pre><code> void bButton_Click(object sender, EventArgs e)
      {
          var richEditText = FindViewById&lt;EditText&gt;(Resource.Id.richEditText);
  
  
          SpannableStringBuilder sb = new SpannableStringBuilder(richEditText.Text);
  
          string selected = sb.SubSequenceFormatted(richEditText.SelectionStart, richEditText.SelectionEnd).ToString();
  
          if(selected == Android.Graphics.TypefaceStyle.Bold) // It,s not working.
          So please suggest  me how to check selected text is bold or not
  
          following line for to make bold
  
          sb.SetSpan(new StyleSpan(Android.Graphics.TypefaceStyle.Bold), richEditText.SelectionStart, richEditText.SelectionEnd,0);
  
  
          richEditText.TextFormatted = sb;
  </code></pre>