androidwebview

load somefile.html file from internal storage to a webview of an app


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.?


Solution

  • I was able to solve my problem by using the following as path:

    webview.loadURL("file:///mnt/sdcard/myfolder/subfolder/index.html");