我正在开发一个在webview上运行的应用程序 他们是一个自动拨打号码的链接,但如果我将其添加到我的WebView并点击该链接,它将退出我的应用程序。
myWebView.loadUrl("http://m.calleridfaker.com");
myWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
setTitle("Loading ..... This app uses Internet connection");
// setProgress(progress * 100);
setProgress(progress);
if(progress == 100)
setTitle(R.string.app_name);
myWebView.loadUrl("javascript: {document.getElementById('id_my_phoneno').value ='"+phoneNumber+"'};");
myWebView.loadUrl("javascript: {document.getElementById('id_email').value ='"+possibleEmail+"'};");
myWebView.loadUrl("javascript: {document.getElementById('admob').style.display ='none'};");
myWebView.loadUrl("javascript: {document.getElementById('download-apps').style.display ='none'};");
myWebView.loadUrl("javascript: {document.getElementById('id_record').style.display ='none'};");
myWebView.loadUrl("javascript: {document.getElementById('secondHeader').style.display ='none'};");
myWebView.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('small')[0].style.display = 'none'; " +
"})()");
myWebView.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('img')[2].style.display = 'none'; " +
"})()");
myWebView.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('div')[20].style.display = 'none'; " +
"})()");
myWebView.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('div')[15].style.display = 'none'; " +
"})()");
}
});
}}
有一个链接导致,当我在WebView中单击它时,应用程序将关闭。