My WebView cannot render an html file stored in the assets folder which contains scripts src (and also CSS path), like
<script type="text/javascript" src="file:///android_asset/emergency.js"></script>
It's showing a white screen.
Any ideas how to fix that?
I've read other answers, but it seems none of them suits my case.
Here is my code from MainActivity.java
WebView browser = (WebView) this.findViewById(R.id.webView);
String html = "file:///android_asset/file.html";
browser.loadDataWithBaseURL("file:///android_asset/", html, "text/html", "utf-8", "");
browser.getSettings().setJavaScriptEnabled(true);
browser.getSettings().setSupportZoom(false);
browser.getSettings().setBuiltInZoomControls(true);
browser.getSettings().setDisplayZoomControls(false);
try {
browser.loadUrl(html);
} catch (Exception e) {
e.printStackTrace();
}