Home > Mobile >  Android studio: How to artificially display a webpage?
Android studio: How to artificially display a webpage?

Time:02-07

I want to show the html file stored in localstorage when I access a webpage using chrome without being connected to the internet.

For example, if you try to access https://google.com without being connected to the Internet

<p>google.com</p>

I want the above html code to be displayed.

How can I perform the above tasks using android studio?

*(My native language is not English. Please forgive me if the sentence is awkward)

CodePudding user response:

Use this code inside activity

 WebView wv;  
 wv = (WebView) findViewById(R.id.webView1);  
 wv.loadUrl("file:///android_asset/aboutcertified.html");
  •  Tags:  
  • Related