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;
}
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;
}
相关文章推荐
- quick-cocos2d使用shader上色置灰问题
- Android 手机设置中的关于手机界面
- 易生活(七)-APP--搜索业务逻辑处理
- Android之粗仿微信6.0——微信分界面
- android提供ToolBar实现划动菜单的陷阱
- Android系统默认Home(Launcher)的启动过程小结
- Android 内容观察者的原理
- Android自动获取短信验证码
- Swift通过类名创建对象
- 了解使用Android ConstraintLayout
- ios method swizzling
- Retrofit与RxAndroid结合使用
- iOS给分类添加属性时使用 @selector()原理详解
- Android Scroll分析(二)——滑动的几种方法
- WKWebView与h5的交互
- Weex Android SDK源码分析之Module(modal)
- canvas的save,restore方法的使用理解
- iOS tableview cell的展开收缩
- Mac安装cocoapods和使用
- iOS-Button点击无反应的原因