【发布时间】:2022-08-19 16:31:56
【问题描述】:
英俊
我试图从 webview 意图“action_dial”。它并不完美。 当我单击“href tag”时,它会打开错误页面,然后也调用拨号页面。 错误页面消息是 \"unknown_url_scheme\"。请帮我
这是我的代码
<a href= \"tel:02-6285-0085\"> 02-6285-0085</a>
安卓
webview.setWebViewClient((WebViewClient) (new WebViewClient() {
public boolean shouldOverrideUrlLoading(@NotNull WebView view, @NotNull WebResourceRequest request) {
Uri uri = request.getUrl();
if (uri.getScheme().equals(\"tel\")){
try {
Intent intent = new Intent(Intent.ACTION_DIAL, uri);
startActivity(intent); //
}catch (Exception ex) {
ex.printStackTrace();
}
}
return false;
}
}));
标签: android html webview href action