I have an HTML file in my /res/raw/test.html
and I will show it in web view using the following code
WebView wbview = (WebView)findViewById(R.id.webView1); InputStream fin; try { fin = getResources().openRawResource(R.raw.manual); byte[] buffer = new byte[fin.available()]; fin.read(buffer); fin.close(); wbview.loadData(new String(buffer), "text/html", "UTF-8"); } catch (IOException e) { e.printStackTrace(); }
And this is my HTML file code
<html> <p> Lorem ipsum dolor sit amet, </p> <table> <tr> <td> <img src=\\"file:///android_asset/test_image2.jpg\"/> <img src="test_image2.jpg" width="50px" alt="Hi"> <img src=\"res/drawable/test_image.png"/> <img src="file:///android_res/drawable/test_image.png" /> <img src=\"file:///android_res/drawable/test_image.png"\ /> </td> </tr> </table> </html>
I want to display the image from the folder of my resource in my html file ... I tried all the opportunity to still not work. It just displays HTML text, but for the image, I have no idea how to display it.
Please help me
android
Aldy Chrissandy
source share