android - webview强制新开窗口
天蓬老师
天蓬老师 2017-04-17 17:29:18
0
2
692

我想要浏览器实现强制新开窗口功能,即每点击一个链接总是强制创建一个webview去加载,请问如何实现?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
Peter_Zhu

//The code is as follows

webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.stopLoading();   //停止加载url
                Intent intent = new Intent(XXX.this, WebActivity.class);
                startActivity(intent);
                return  true;
            }  
        });
        

Hope it’s useful to you, the above

迷茫

Link description

This is okay

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template