简体   繁体   中英

Load HTML file using MonoDroid

I want to load an local html file as part of my Help Screen. I have placed the file "test.html" in my Assets folder.

Here is my code:

WebView web_view;

web_view=FindViewbyId<WebView>(Resource.Id.webview);
web_view.Settings.JavaScriptEnabled=true;
web_view.LoadUrl("file://test.html");

I am getting a "Web page not available" error.

Thanks in advance. TB

web_view.LoadUrl("file:///android_asset/test.html); 

Use this line instead of that

web_view.LoadUrl("file:///test.html);

Use this line instead of that because use "file:///" not "file://" please change and after Run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM