I am trying to get my android webview app to open tel: links to the phone. Every time I open up a telephone link it works great and opens up the phone. However once I am done with my call and go back to the app it is at a page that says "Web Page Not Found tel:0000000000". Then I have to hit the back button once more to get to the page that I clicked the telephone number on.
Is there a way to get it to open the TEL link without trying to find the page in webview as well as opening it up on the phone?
This is code I am using in WebView to override its handling of the TEL and Mailto links:
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("mailto:") || url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(url));
startActivity(intent);
}
view.loadUrl(url);
return true;
}
Any help would be appreciated. I have spent the last 2 hours scouring goodle and have failed to produce any answers.
WebViewClient
correctly? Does everything else work?