Skip to content Skip to sidebar Skip to footer

Using Webview's Loaddatawithbaseurl Not Loading Images From Sdcard

I would like to set some html content in my webview with some pictures. I've read on the internet i must use loadDataWithBaseUrl to do such a thing because i need to link the folde

Solution 1:

You have a syntax error in your loading statement. You have to put : after file

myWebView.loadDataWithBaseURL("file:///mnt/sdcard/com.mypackage.myproject/3", myHtml, "text/html", "utf-8", "");

Solution 2:

You don't need to put full path of your image into html.

img src="images/test1.jpg"

Instead

img src=\""+ imagePath + "\"

Post a Comment for "Using Webview's Loaddatawithbaseurl Not Loading Images From Sdcard"