I\'m trying to load an html page from a server the page contains a script that links to android sdcard .js file.
Java:
String url =\"http://192.168.8
String htmlStr="..your html data in string..\"data/replace.js\" ";
if (htmlStr.contains("\"data/replace.js\"")) {
String html = data.replace("\"data/replace.js\"", "\"file:///storage/emulated/0/documents/HtmlContent/new_replace.js\"");
((Activity) mContext).runOnUiThread(() -> {
loadDataWithBaseURL("file:///storage/emulated/0/documents/HtmlContent/", html, "text/html", "UTF-8", "");
});
}
Try following code to load Html content from sdcard.
String fileName = "something.html";
File lFile = new File(Environment.getExternalStorageDirectory() + fileName);
webview.loadUrl("file:///" + lFile.getAbsolutePath());