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

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top