Detecting Webview Error and Show Message

Solution 1:

All answer above are deprecated. You should use this code after on Page finished

 @Override
    public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error){
           //Your code to do
        Toast.makeText(getActivity(), "Your Internet Connection May not be active Or " + error.getDescription(), Toast.LENGTH_LONG).show();
    }

Solution 2:

You're most of the way there... Just implement onReceivedError and handle the errors that you want.