Agenweb intercepts the address of the click event in the webpage and opens it with the default browser

When using Agenweb without setting, the download button in the web page does not respond when clicked. But open this address in WeChat, click to download or jump to the default browser. It needs to be rewritten, and the interception method is as follows:

mAgentWeb.getWebCreator().getWebView().setWebViewClient(new WebViewClient() {
            // url拦截
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                // 使用默认浏览器器加载页面
//                Log.e("tag",url);
                Intent intent= new Intent();
                intent.setAction("android.intent.action.VIEW");
                Uri content_url = Uri.parse(url);
                intent.setData(content_url);
                intent.setClassName("com.android.browser","com.android.browser.BrowserActivity");
                startActivity(intent);
                return true;
            }

        });

Guess you like

Origin blog.csdn.net/BigBingtang/article/details/125015848