I want to change the page "Web page is not available." That in the absence of connection my html file (noconnect.htm) would open. How to implement it?
1 answer
For example :
WebView mWebView; ... mWebView.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { mWebView.loadUrl("file:///android_asset/myerrorpage.html"); } }); The loadUrl(...) is the path to the page you want to display.
- oneI want to note that
onReceivedErrorbehaves very strangely and by 60% the standard screen still shows for a split second. - Flippy
|