I have some images image1.jpg, image2.jpg etc in assets folder. How to display these images using html with tag in String like below:
WebView webView = (WebView) findViewById(R.id.webView1);
String desc = "Hello, This is my newly created App with the icon
<img src='file://android_asset/image1.jpg'>. Since i'm new to android i'm learning
it step by step. <img src='file://android_asset/image2.jpg'> Thank you so much.";
webView.loadData(desc, "text/html","utf-8");
When i tried like above the image is not displaying. So i tried like:
webView.loadDataWithBaseURL("file:///android_asset/", "<img src='image1.jpg' />"+desc, "text/html", "utf-8", null);
Here can able to display image1 only, but not image2.
I tried many examples using loadDataWithBaseURL but all those are helpful for displaying one image on webview. But i want to display this String "desc" in webview like text followed by image and then followed by text like that. Please someone give me idea on how to resolve this ASAP.
Thanks in advance.