Many times we need to load an html file from device sdcard to webview. For example, you normally load a url in webview when network is available, but in case network is not available currentl, you need to load latest offline html file which was previously cached on device sdcard.
Now, in this case, you cannot load a file directly in webview by just giving file’s path in loadUrl(String url) method of webview. for example:
This will not work. You need to implement you own Content Provider for accessing the file in webview.
Below are the Steps to implement and use Content Provider:
1) Declare your content provider in android manifest file.