How to load html
files in WebView
from raw
folder. I don't know how to add the path of these html
files in WebView.loadData()
function. I know how to load file from asset
folder in WebView
but here getting problem with raw
folder.
Thanks in advance
Use this code for Load html files from raw folder in web view:
For more information see the javadoc for WebView:
public class ViewWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webview); WebView lWebView = (WebView)findViewById(R.id.webView); lWebView.loadUrl("file:///android_res/raw/your_file_name.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