I have a WebView that I'm using to display some html/image files
stored in the assets/ directory. I'm able to have the WebView load and
html page fine with:

mWebView.loadUrl("file:///android_asset/ContentRoot/SubDir/
file.html");

or

String data = inputStreamToString(getAssets().open("ContentRoot/SubDir/
file.html"));
mWebView.loadDataWithBaseURL("file:///android_asset/ContentRoot/",
data, "text/html", "utf8", null);

The problem I'm having is that there are images in the HTML with
relative URLs like:

<img src="../Photos/image.jpg" alt="whatever" />

and instead of loading from assets/ContentRoot/Photos/image.jpg it's
trying to load them from assets/Photos/image.jpg.

Why is it trying to load them from the wrong (relative) location and
what can I do to correct the issue?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to