Code example for WebViewClient

Methods: shouldOverrideUrlLoading

        return isErrorOccredDuringLoadUrl;
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        return webViewClient.shouldOverrideUrlLoading(view, url);
    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)); 
Connect your IDE to all the code out there  Get Codota for Java