if (openAlipayPayPage(getContext())) {
ToastUtils.showLong("即将跳转支付宝");
} else {
ToastUtils.showLong("未能打开支付宝,请手动打开");
}
public static boolean openAlipayPayPage(Context context) {
try {
// final String alipayqr = "alipayqr://platformapi/startapp?saId=10000001&clientVersion=3.7.0.0718";
final String alipayqr = "alipayqr://platformapi/startapp?clientVersion=3.7.0.0718";
openUri(context, alipayqr);
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
/**
* 发送一个intent
*/
private static void openUri(Context context, String s) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(s));
context.startActivity(intent);
}
参考链接
Android打开第三方应用方法总结
Android应用市场和应用包名大全