I\'m trying to display an image in a WebView in an Android app. The image exists in the assets folder of my Android project. The HTML is programmatically built and has this
OK, I finally figured this out. Apparently there is a bug somewhere in the Android code where it fails if the image path has a space in it. So:
<img src="file:///android_asset/SkyInfo/images/Deep Sky/M13-Misti.jpg">
will fail to load the image. If you change it to:
<img src="file:///android_asset/SkyInfo/images/DeepSky/M13-Misti.jpg">
it will work (assuming you've renamed the directory).
Note:
Come on Google, spaces in directory names have been common for 15 years. Get with the program.
webView.loadDataWithBaseURL("file:///android_asset/", sourse, "text/html", "UTF-8", null);