Trey Balut
Trey Balut

Reputation: 1395

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

Upvotes: 0

Views: 778

Answers (2)

Sanjay Patel
Sanjay Patel

Reputation: 1022

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

Use this line instead of that

Upvotes: 3

Sanjay Patel
Sanjay Patel

Reputation: 1022

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

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

Upvotes: 0

Related Questions