[英]The webpage at file:///android_asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND
I don't why I'm getting an error:-我不知道为什么我会收到错误:-
The webpage at file:///android_asset/file.html could not be loaded because: net::ERR_FILE_NOT_FOUND
无法加载位于 file:///android_asset/file.html 的网页,因为:net::ERR_FILE_NOT_FOUND
WebSettings mysettings = myweb.getSettings();
mysettings.setJavaScriptEnabled(true);
mysettings.setDomStorageEnabled(true);
myweb.loadUrl("file:///android_asset/www/file.html");
myweb.setWebViewClient(new WebViewClient());
Here Is my file这是我的文件
/RandomPasswordGenerator/app/src/main/assets/www/file.html
/RandomPasswordGenerator/app/src/main/assets/www/file.html
Ensure that you have not created another folder called android_asset .确保您没有创建另一个名为android_asset的文件夹。 Since you've not shown your assets directory, let the www folder be inside the assets folder (app > src > main >assets) .
由于您没有显示资产目录,因此将www文件夹放在资产文件夹中(app > src > main >assets) 。 The matter is, what you must give as 'android_asset' is actually shown as 'assets' in the directory listing.
问题是,您必须作为“android_asset”提供的内容实际上在目录列表中显示为“assets”。 With this, you can find yourself a solution by rightly targeting your files.
有了这个,您可以通过正确定位您的文件来找到自己的解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.