In my project I have a files:
"MyProject/assets/folder1/image1.jpg"
"MyProject/assets/folder1/index.html".
In webView I need to open index.html (with images).
I trying this code:
String baseUrl = "file:///android_asset/folder1/";
webView.loadDataWithBaseURL(baseUrl, readFileAsString("index.html") , mimeType, "UTF-8", null);
But images don't loading.
If I put images to "assets" directory (MyProject/assets/
) and make baseUrl = "file:///android_asset"
images are loaded correctly;
How load images not only from root assets directory, but and from assets/folder1
?