I have a section on my Android app called ‘More Information’ which is basically a few pages of Html scripts which I display using WebView with the following code –
InputStream fin = getAssets().open(htmlFl + ".html");
byte[] buffer = new byte[fin.available()];
fin.read(buffer);
fin.close();
webview.loadData(new String(buffer), "text/html", "UTF-8");
It all works fine except that the images are not appearing on any of the pages. I declare them using Html like the following –
<P><IMG SRC="http://www.OurWeb.co.uk/images/Icon.jpg">&
nbsp;<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">
<B>Opening Times During Exhibition</B></SPAN></P>
Am I doing anything wrong using the WebView and if not is there a way around this?
You probably forgot to add
INTERNETpermission in your manifest:The WebView javadoc says: