How do I open each link on a webview to chrome custom tab?
<p>I would like to open each link on webview to chrome custom tabs when the link is clicked or tabbed.</p>

<pre><code>final WebView webView = (WebView) findViewById(R.id.web_view);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webView.setWebViewClient(new WebViewClient(){
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            webView.loadUrl(uri);
            return true;
        }

        @Override
        public void onLoadResource(WebView view, String url) {
            if (url.startsWith(uri)){
                webView.loadUrl(uri);
            }else{
                Uri uri = Uri.parse(url);
                CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
                builder.build().launchUrl(MainActivity.this, uri);
            }
        }
    });
</code></pre>