title: Android WebView shows plain text instead of html
body: <p>First, I am going to say this is only an issue on Android 2 and older (4 seems to be unaffected and I didn't test 3).</p>
  
  <p>I have a <code>WebView</code> that loads html from a string.  The HTML looks like this:</p>
  
  <pre><code>&lt;html&gt;  
      &lt;head&gt;
          &lt;link rel='stylesheet' type='text/css' href='http://www.robotsidekick.com/test.css?rev=0' /&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Hello World&lt;/h1&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>You can see that css file looks like this:</p>
  
  <pre><code>body {
      font-family: "Lucida Console", "Lucida Sans Typewriter", Monaco, "Bitstream Vera Sans Mono", monospace;
  }
  h1 {
      border-bottom: 3px solid #ccc;
  }
  </code></pre>
  
  <p>The <code>WebView</code> code looks like this:</p>
  
  <pre><code>final WebView webview = new WebView(this);
  setContentView(webview);
  final String result = "&lt;html&gt;&lt;head&gt;&lt;link rel='stylesheet' type='text/css' href='http://www.robotsidekick.com/test.css?rev=0' /&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Hello World&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;";
  webview.loadData(result, "text/html", Encoding.UTF_8.toString());
  </code></pre>
  
  <p><strong>What Happens</strong></p>
  
  <p>I see the html code in the <code>WebView</code> as if I had set the mime type to plain text.</p>
  
  <p><img src="https://i.stack.imgur.com/VEjd2.png" alt="what happens html as plain text"></p>
  
  <p><strong>What I'd Expect (and what happens in Android 4.x</strong></p>
  
  <p>I see the html in the <code>WebView</code>  </p>
  
  <p>There are a few things that have to be true to show the symptoms I am seeing:  </p>
  
  <ul>
  <li>Android 2.x (I was using 2.3.7 and 2.2)</li>
  <li>The css has to be accessed via a url <code>href="http://www.robotsidekick.com/test.css?rev=0"</code> as opposed to <code>href="test.css"</code> (however it doesn't matter if it's a real css file <code>href="http://www.thisisnotarealurl.fake/test.css?rev=0</code> causes the same problem)</li>
  <li>The css must have a get parameter <code>?rev=0</code>, but it doesn't matter what it is</li>
  </ul>
  
  <p>Also wanted to note that the following did not make a difference:  </p>
  
  <ul>
  <li>Using the appropriate <code>"</code> instead of <code>'</code> in the HTML</li>
  <li>Having the <code>link</code> tag close itself or not</li>
  <li>The contents of the css</li>
  <li>Adding a doctype <code>&lt;!DOCTYPE html&gt;</code> to the HTML</li>
  </ul>