title: WebView, add local .CSS file to an HTML page?
body: <p>In android I'm using WebView to display a part of a webpage which I fetched from the internet using HttpClient from Apache. To only have the part I want from the html, I use Jsoup.</p>
  <pre><code>String htmlString = EntityUtils.toString(entity4); // full html as a string                                 
  Document htmlDoc = Jsoup.parse(htmlString); // .. as a Jsoup Document
  Elements tables = htmlDoc.getElementsByTag(&quot;table&quot;); //important part
  </code></pre>
  <p>Now I can just load <code>tables.toString()</code> in the WebView and it displays. Now I want to link a CSS file which I store inside my assets folder with this page. I know I can have something like</p>
  <pre><code>&lt;LINK href=&quot;styles/file.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt;   
  </code></pre>
  <p>In my html, but how do I link it so that it uses the one I've stored locally?</p>
  <p>---EDIT---<br />
  I've now changed to this:</p>
  <pre><code>StringBuilder sb = new StringBuilder();
      sb.append(&quot;&lt;HTML&gt;&lt;HEAD&gt;&lt;LINK href=\&quot;file:///android_asset/htmlstyles_default.css\&quot; type=\&quot;text/css\&quot; rel=\&quot;stylesheet\&quot;/&gt;&lt;/HEAD&gt;&lt;body&gt;&quot;);
      sb.append(tables.toString());
      sb.append(&quot;&lt;/body&gt;&lt;/HTML&gt;&quot;);
      return sb.toString();
  </code></pre>
  <p>Somehow I do not get the styles applied to the page. Is it the location path I used that is wrong?</p>