Error Net::err_unknown_url_scheme Tel:
I buit an webview app with Android Studio and in my website i have a link like tel:0752118 when i press this link from app return eror net::err_unknown_url_scheme This is my MainAc
Solution 1:
If the links contain geographic locations, phone numbers, and email addresses, you can switch to the search screen and mail client using the code below.
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(intent);
view.reload();
return true;
} else if (url.contains("mailto:")) {
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
} else if(url.contains("geo:")) {
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(url)));
return true;
} else {
view.loadUrl(url);
return true;
}
}
Post a Comment for "Error Net::err_unknown_url_scheme Tel:"