Open dialer example

suggest change

If the web page a contains phone number you can make a call using your phone’s dialer. This code checks for the url which starts with tel: then make an intent to open dialer and you can make a call to the clicked phone number:

public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if (url.startsWith("tel:")) { 
            Intent intent = new Intent(Intent.ACTION_DIAL,
                    Uri.parse(url)); 
            startActivity(intent); 
    }else if(url.startsWith("http:") || url.startsWith("https:")) {
        view.loadUrl(url);
    }
    return true;
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents