title: android Textview text background colour like WebSites
body: <p><a href="https://i.stack.imgur.com/yaoJk.png" rel="nofollow noreferrer">output i'm getting.</a>I'm creating app in which I'm setting background color of <code>textview</code> using BackgroundColorSpan. But it's output different than i want.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>Spannable spannable = new SpannableString(inputTextView.getText()); 
  BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(a); 
  spannable.setSpan(backgroundColorSpan, 0, inputTextView.getText().toString().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  inputTextView.setText(spannable);
  </code></pre>
  
  <p>And </p>
  
  <pre><code>String s ="&lt;span style='background-color: #FFFFFF; line-height: 2.0;'&gt;"+inputTextView.getText()+"&lt;/span&gt;";   
  inputTextView.setText(Html.fromHtml(s)); 
  </code></pre>
  
  <p>Screenshot of website text i want to make in android</p>
  
  <p><a href="https://i.stack.imgur.com/vbu15.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vbu15.png" alt="enter image description here"></a></p>