您的位置:首页 > 移动开发

webview支付时候遇到的坑

2016-06-18 16:37 225 查看
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调起微信客户端支付

if (url.startsWith("weixin://wap/pay?")) {

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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: