I have a WebView. I want to load a local HTML file called helloworld.html. It is located in my drawable-hdpi folder.
Here is my code:
webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/helloworld.html");
I get a browser error:
The webpage at file:///android_asset/helloworld.html could not be loaded as the file requested was not found. /android_asset/helloworld.html (no such file or directory)
How can I resolve?
Put your HTML file in the assets folder.
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