未检测到来自android webview单击的javascript重定向?

未检测到来自android webview单击的javascript重定向?,javascript,android,html,redirect,Javascript,Android,Html,Redirect,我想重定向到android webview上的网页单击,我已将下面的代码放在javscript中,它不起作用。请帮助我解决此问题。谢谢 function redirectCall(message) { if ((navigator.userAgent.indexOf('Android') != -1)) { document.location = "http://www.google.com"; } }

我想重定向到android webview上的网页单击,我已将下面的代码放在javscript中,它不起作用。请帮助我解决此问题。谢谢

function redirectCall(message) {        
    if ((navigator.userAgent.indexOf('Android') != -1)) {
    document.location = "http://www.google.com";
    } 
}