Code example for WebViewClient

Methods: shouldOverrideUrlLoading

0
        return isErrorOccredDuringLoadUrl;
    } 
 
    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        return webViewClient.shouldOverrideUrlLoading(view, url);
    } 
 
    @Override 
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        measureStartMillis = System.currentTimeMillis(); // for measuring loading time
 
        isErrorOccredDuringLoadUrl = false;
 
        if (!UriUtils.isValidDomain(url, validDomains)) {
            // FIXME define specific error 
            throw new LoadInvalidDomainUrlException("cannot load " + url);
 
            // or launch browser. ex 
            //Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));