Code example for WebViewClient

0
   * 
   * @param client the WebViewClient used by the WebView. 
   */ 
  public DefaultViewClient(WebViewClient client) {
    if (client == null) {
      delegate = new WebViewClient();
    } else { 
      delegate = client;
    } 
  } 
 
  public void setDriver(AndroidWebDriver driver) {
    this.wdViewClient = new WebDriverViewClient(driver);
  } 
   
  @Override 
  public void onReceivedError(WebView view, int errorCode, String description,
      String failingUrl) {
    wdViewClient.onReceivedError(view, errorCode, description, failingUrl);
    delegate.onReceivedError(view, errorCode, description, failingUrl);