WebView拦截H5微信支付

直接上代码

webview.setWebViewClient(new WebViewClient() {

@Override

    public boolean shouldOverrideUrlLoading(WebView view, String url) {

        if (url.startsWith("weixin://")) {

                Intent intent =new Intent();

                intent.setAction(Intent.ACTION_VIEW);

                intent.setData(Uri.parse(url));

                startActivity(intent);

                return true;

        }

        return false;

    }

});

你可能感兴趣的:(WebView拦截H5微信支付)