html5网页中 webview调起支付宝客户端支付
if (url.contains("http://wappaygw.alipay.com")) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}
html5网页中 webview调起微信客户端支付
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}
出现如下错误 ,net::ERR_UNKNOW_URL_SCHEME,应在load(url)之前加入如下代码
if (url.startsWith("http:") || url.startsWith("https:")) {
return false;
}
本文介绍如何在HTML5的WebView环境中通过特定URL方案调用支付宝和微信客户端进行支付。针对不同支付场景,提供了具体的Intent启动示例,并解决net::ERR_UNKNOW_URL_SCHEME错误。
184

被折叠的 条评论
为什么被折叠?



