title: Displaying Android asset files in a WebView?
body: <p>I have seen various discussions on the problem of serving WebView pages from assets, none of which seemed definitive.</p>
  
  <p>I want to be able to use a webview to display html (and included css) files stored in the project assets.</p>
  
  <p>I have found that wv.loadUrl("file:///android_asset/html_no_copy/demo_welcome.html") displays that file okay, but links in demo_welcome.html, either local (no url prefixing the file name) or absolute - the same form as fed to loadUrl - don't work. They get a "Web page not available" error displayed on the view.</p>
  
  <pre><code>WebView wv = (WebView)this.findViewById(R.id.splashWebView);
  wv.loadUrl("file:///android_asset/html_no_copy/test.html"); // Works
  </code></pre>
  
  <p>or</p>
  
  <pre><code>wv.loadUrl("file:///android_asset/html_no_copy/demo_welcome.html"); // Works
  </code></pre>
  
  <p>But neither of the following links in demo_welcome.html work:</p>
  
  <pre><code>&lt;a href="test.html"&gt;CLICK HERE&lt;/a&gt;&lt;p&gt;
  &lt;a href="file:///android_asset/html_no_copy/test.html"&gt;OR HERE&lt;/a&gt;
  </code></pre>
  
  <p>I know I can get around this by writing a content provider, but that seems extreme.</p>
  
  <p>I want this to work from SDK 1.6 (4) on up. </p>
  
  <p>Does anyone know if this can be done with just HTML, or does one need to kluge up some code to load the data?</p>