2017-06-22 98 views

回答

0

创建一个WebViewClient,并覆盖shouldOverrideUrlLoading方法。

webview.setWebViewClient(new WebViewClient() { 
    public boolean shouldOverrideUrlLoading(WebView view, String url){ 
     // do your handling codes here, which url is the requested url 
     // probably you need to open that url rather than redirect: 
     view.loadUrl(url); 
     return false; // then it is not handled by default action 
    } 
}); 
相关问题