Question

how can add my own error page replacing default error page "webpage not available" when there no internet connection available. like below image http://i.stack.imgur.com/OgS7o.jpg

Was it helpful?

Solution

i got solution by adding below code

mWebView.setWebViewClient(new MyWebViewClient()
  {
    public void onReceivedError(WebView webview, int i, String s, String s1)
  {
      mWebView.loadUrl("file:///android_asset/error.html");
  }
   });

put your own html error page in assets folder

OTHER TIPS

Simply apply Broadcast receiver and register Network Connection event when event rising according to there status redirect your page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top