我正在尝试打开tel: & mailto:链接webview
,并收到以下消息:
Web Page Not Found tel:0000000000
唯一有效的链接是“http:”和“https”
谁能帮我?
private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView webview, String url)
{
webview.loadUrl(url);
return true;
}
}
@Override
public boolean onKeyDown(int KeyCode, KeyEvent event)
{
if ((KeyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack())
{
mWebView.goBack();
return true;
}
return super.onKeyDown(KeyCode, event);
}
public boolean shouldOverrideUrlLoading(WebView webview, String url) {
if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(url));
startActivity(intent);
}else if(url.startsWith("http:") || url.startsWith("https:") || url.startsWith("mailto:")) {
webview.loadUrl(url);
}
return false;
}
}