title: android webview = webpage not found = where to add onReceivedError
body: <p>I m a newbie, please guide me where to add the onReceivedError code.</p>
  
  <p>This is my original code:</p>
  
  <p>My static page directs to my website, if the internet is slow or no network connect, I get a error showing url, I would like to show another html error page, if possible even reload button.</p>
  
  <p>Thanks in advance for guidance.</p>
  
  <pre><code>    public class WebActivity extends Activity {
  
      private WebView webView;
  
      public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.webcontent);
  
      webView = (WebView) findViewById(R.id.webView);
  
      webView.getSettings().setJavaScriptEnabled(true);
  
      webView.setWebViewClient(new WebViewClient());    //the lines of code added
      webView.setWebChromeClient(new WebChromeClient()); //same as above
  
      webView.loadUrl("file:///android_asset/index.html");
  
      }
  
              @Override
              public void onBackPressed() {
                      if (webView.canGoBack()) {
                              webView.goBack();
                      } else {
                              super.onBackPressed();
                      }
              }
  </code></pre>
  
  <p>Where to place the below code:  please guide
  Or any improvements </p>
  
  <pre><code>            @Override
              public void onReceivedError(WebView WebResourceRequest WebResourceError) {
              webView.loadUrl("file:///android_asset/errorpage.html");
  </code></pre>