I have a file in the internal storage of my tablet. /myfolder/subfolder/index.html. How can i load this into a webview of an app.
i have tried
webview.loadURL("file:///myfolder/subfolder/index.html");
but it is not giving the expected result. it says web page not available.
I know how to load from the asset folder or from the web/internet. but i need to load local file into webview. is it possible.?
File file = new File("/data/data/packagename/foldername/");
webView.loadUrl("file:///" + file);
I was able to solve my problem by using the following as path:
webview.loadURL("file:///mnt/sdcard/myfolder/subfolder/index.html");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With