title: Webview AppCache not loading sourced non-html content
body: <p>I'm using HTML5 AppCache to create an Android web app which can function offline.  HTML which sources additional images, stylesheets, javascript and iframes is loaded into a WebView with loadDataWithBaseURL().  Unfortunately, when the device is offline only the HTML sourced in iframes is loaded from AppCache.</p>
  
  <p>At this point, I know:</p>
  
  <ul>
  <li>This content does exist in the AppCache, since I dumped the content of the AppCache.db file with adb shell and found all the content in there.</li>
  <li>It's probably not a domain problem, since I'm specifying the correct path in the baseUrl field of loadDataWithBaseURL().  Also, a workaround to this problem succeeds without domain errors, as discussed below.</li>
  </ul>
  
  <p>Here's some demo code:</p>
  
  <pre><code>public class ExampleActivity extends Activity {
  
     ...
  
    // HTML to be inserted into the Webview with loadDataWithBaseURL()
    public static final String ALL_HTML = 
        "&lt;!DOCTYPE HTML&gt;&lt;html&gt;" +
        "&lt;head&gt;&lt;script src='sourced_js.js' " +
           "onload='console.log(\"sourced_js.js onload\");'&gt;" +
        "&lt;/script&gt;" +
        "&lt;link rel='stylesheet' href='style.css' /&gt;" +   // doesn't load offline
        "&lt;/head&gt;&lt;body&gt;" +
        "&lt;iframe src='manifest.html'&gt;&lt;/iframe&gt;" +        // loads
        "&lt;img src='android.jpg' /&gt;" +                    // doesn't load
        "&lt;img src='android.gif' /&gt;" +                    // doesn't load
        "&lt;/body&gt;&lt;/html&gt;";
  
    public void onCreate(Bundle savedInstanceState) {
  
      ...
  
      WebView webView = new WebView(context);
      webView.clearCache(true);
  
      WebSettings settings = webView.getSettings();
      settings.setAppCacheEnabled(true);
      settings.setJavaScriptEnabled(true);
  
      webView.loadDataWithBaseURL("http://my.website.com/path/to/content/",
          ALL_HTML, "text/html", "utf-8", null);
    }
  }
  </code></pre>
  
  <p><code>manifest.html</code> is just responsible for referencing the manifest.  It looks like:</p>
  
  <pre><code>&lt;html manifest="manifest.appcache"&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>manifest.appcache</code> looks like:</p>
  
  <pre><code>CACHE MANIFEST
  
  # Explicitly cached resources
  # manifest.html automatically cached
  sourced_js.js
  android.jpg
  android.gif
  style.css
  
  NETWORK:
  *
  </code></pre>
  
  <p>When online, all content loads.  When offline, only the iframe with <code>manifest.html</code> loads.  The images, stylesheet and javascript are not loaded.</p>
  
  <p>Strangely enough, if I source the exact same static content (<code>sourced_js.js</code>, <code>android.jpg</code>, ...) in <code>manifest.html</code>, they all load from AppCache in the iframe properly when the device is offline!  As if these other resources have to be sourced secondarily from a static page.</p>
  
  <p>Any clue why this content won't be loaded from the AppCache?</p>