WXPayEntryActivity回调
@Override
public void onResp(BaseResp resp) {
MyLogUtil.e("微信支付回调", "微信支付的结果errCode = " + resp.errCode);
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
EventBus.getDefault().post(new WXPayEvent(resp.errCode));
}
finish();
overridePendingTransition(0,0);
}
清单文件微信
<!-- 微信支付回调页面-->
<activity
android:name="com.wuxunkj.www.wxapi.WXPayEntryActivity"
android:exported="true"
android:theme="@style/wxTheme"
android:launchMode="singleTop" />
styles样式:<style name="wx_theme" parent="AppTheme">
<item name="android:windowBackground">@color/translucent</item>
<item name="android:windowIsTranslucent">true</item></style>
已试过,不出现闪动问题
转载:https://blog.youkuaiyun.com/qq_17524035/article/details/80679346
本文介绍了一个Android应用中实现微信支付回调的方法。通过重写onResp方法处理BaseResp响应,并使用EventBus发布支付结果事件。为避免界面闪动问题,文中还提供了自定义主题样式。
1664

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



