I'm trying to display the contents of an HTML file with the method in Android.
I is just a string that contains the HTML file data in the source of a string name and I give it to the method.
For example
string source; // contains HTML tags with images in the view.loadDataWithBaseURl (faucet, source, "text / html", "UTF-8", "about: blank");
The data displayed in the scene is OK. My problem is that if I have any image in my HTML file then I could not show it? How can I do this?
You can do this, if the images in the source are Src then you should set the base URL to "Base" Where the pictures will be located. For example, if you are loading Google's homepage from the source, then it will look like this:
View.loadDataWithBaseURI ("http://google.com", "Source," text / Html "" UTF-8 "," about: blank ");
This webview tells where images will be loaded.
As a side note, I do not think "file: //" works in the URI web for security reasons.
Comments
Post a Comment