微信支付问题:WeChatNotifyActivity} did not call finish() prior to onResume() completing
在前人留的工程项目中进行渠道替换对接支付,使用的微信支付,但是以前一直都是通过现在支付把微信支付进行了融合,而且只有微信支付,(现在支付是一个集成了支付宝,微信,百度金融,京东金融等平台的聚合类sdk)不知道当初为什么这样设计,只有微信的还有选聚合的sdk。
在Eclpise转Android Studio运行的项目中进行微信支付操作正常,但是当 我把项目中代码全部放到 Android Studio 形式的 工程时再运行出现 调用相应的Activity崩溃。
Android Studio项目 Eclipse 转 Android Studio项目
崩溃如下: Caused by: java.lang.IllegalStateException: Activity {com.orange.org_player_new_alone194818.game4399/com.ipaynow.wechatpay.plugin.inner_plugin.wechat_plugin.activity.WeChatNotifyActivity} did not call finish() prior to onResume() completing
在华为4.4的系统上没有出现这个问题,就可能和系统有关。
关键之处就是 did not call finish() prior to onResume() completing
在网上搜到一个 An activity without a UI must call finish() before onResume() completes ,而我们的问题也是和这个类似的。在Android 源码中
final void performResume() {performRestart();mFragments.execPendingActions();mLastNonConfigurationInstances = null;mCalled = false;// mResumed is set by the instrumentationmInstrumentation.callActivityOnResume(this);if (!mCalled) {throw new SuperNotCalledException("Activity " + mComponent.toShortString() +" did not call through to super.onResume()");}// invisible activities must be finished before onResume() completesif (!mVisibleFromClient && !mFinished) {Log.w(TAG, "An activity without a UI must call finish() before onResume() completes");if (getApplicationInfo().targetSdkVersion> android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {throw new IllegalStateException("Activity " + mComponent.toShortString() +" did not call finish() prior to onResume() completing");}}// Now really resume, and install the current status bar and menu.mCalled = false;mFragments.dispatchResume();mFragments.execPendingActions();onPostResume();if (!mCalled) {throw new SuperNotCalledException("Activity " + mComponent.toShortString() +" did not call through to super.onPostResume()");}
}
主要部分:
// invisible activities must be finished before onResume() completesif (!mVisibleFromClient && !mFinished) {Log.w(TAG, "An activity without a UI must call finish() before onResume() completes");if (getApplicationInfo().targetSdkVersion> android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {throw new IllegalStateException("Activity " + mComponent.toShortString() +" did not call finish() prior to onResume() completing");}}
这部分源码就是抛出的崩溃日志
An activity without a UI must call finish() before onResume() completes
也就是我们的Activity 没有UI,所以 要进行主题设置。
<activity android:name=".DialogActivity" ...android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
把主题设置为 如上即可。
但是从Eclipse 转的项目 Android Studio ManiFest 都一样,为什么会出现以前项目android:theme 不是Translucent.NoTitleBar可以正常运行,自己创建的 Android Studio会崩溃,然后想了一下应该是 gradle targetSdkVersion 配置问题,targetSdkVersion已经超过6.0了,以前的没有这么高所以运行的时候并不优先选择 6.0系统,而是选择 targetSdkVersion 运行的环境。
所以修复这个问题可以通过修改相应的 activity theme,也可以通过修改targetSdkVersion 修复这个问题
微信支付问题:WeChatNotifyActivity} did not call finish() prior to onResume() completing相关推荐
- 安卓6.0以上机型微信登录时提示Activity did not call finish() prior to onResume() completing
** 安卓6.0以上机型微信登录时提示Activity did not call finish() prior to onResume() completing ** 今天遇到这样的一个bug,我 ...
- bug:did not call finish() prior to onResume() completing at android.app.Activity.performResu
did not call finish() prior to onResume() completing at android.app.Activity.performResume(A ...
- Android Activity did not call finish() prior to onResume() completing
Activity did not call finish() prior to onResume() completing 这个错误是针对6.0以上Activity使用Theme.NoDisplay ...
- did not call finish() prior to onResume() completing
异常信息: java.lang.RuntimeException: Unable to resume activity {com.ltgame.zhglm.niguang/com.heepay.plu ...
- Activity did not call finish() prior to onResume() completing原因和解决办法
最近发现一个针对6.0 Activity使用Theme.NoDisplay style 时候爆出这个log, Google的处理方式是直接fatal crash,很蛋疼. log里面给出了解决方法,在 ...
- Android端接入微信支付
1.接入微信SDK implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' 2.从公司业务后台拿到订单信息后调 ...
- java ios支付接口开发_微信支付接入(Android/IOS(swift)/Java后台)
创建 包名.wxapi.WXPayEntryActivity 文件,保证内容如下(WechartUtils下面会给出): import android.app.Activity; import and ...
- Android之微信支付
Android开发中,大多数电商APP都会有支付这么模块,此博客就讲一下微信支付,代码不多,很简单就可以完成,支付宝支付请看博客 Android支付之支付宝封装类 先来看看效果图 微信支付首先要去微信 ...
- android 支付宝和微信支付封装,Android支付宝和微信支付集成
场景 随着移动支付的兴起,在我们的app'中,会经常有集成支付的需求.这时候一般都会采用微信和支付宝的sdk 来集成 (一)支付宝支付 在使用支付宝支付的过程中,我们是在服务器端生成订单,客户端访问接 ...
最新文章
- GitHub上3天1W赞的程序员学习路线!入门进阶都非常实用
- 努比亚连续按下android版本,虚惊一场!努比亚Z17的Android 9.0真的不远了
- AUTOSAR从入门到精通100讲(131)-AURIX中DMA模块对TIM的FIFO数据搬运
- android系统相机自动录像,android 调用系统相机录像并保存
- Django中模型类 属性-学习笔记
- layui左侧三级菜单2.0
- web前端是不是没有前景了?
- nginx - 性能优化
- Ubuntu新版发布周期
- 归并排序MergeSort
- 纯前端html导出pdf(jsPDF.js)-分页-不分页
- leach算法的实现过程_LEACH-REC算法的研究及实现
- 第十届泰迪杯数据挖掘大赛B题电力系统负荷预测
- Neokylin7安装DM8数据库
- 理论物理极础附录:有心力和行星轨道
- “苏宁SAP上线“有感(原)
- [CTF] python的pip源更改及常用python库
- 企企通SRM项目再获肯定,助力迈金科技一站式数字化采购平台成功上线
- 徐宗本院士:智能制造的大数据机遇与挑战
- Linux-read函数
热门文章
- 趣图:程序员的生活写照
- python判断日期是否是休息日,如果是,就往后加,一直加到非休息日
- SQL(创建新表导入数据)
- 程序员,请对自己好一点
- Flume报错:Space for commit to queue couldn't be acquired Sinks are likely not keeping
- 优酷的视频地址获取接口
- 内网渗透系列:内网渗透思路整理
- 【教学类-36-08】20230707转学“纪念册“留念(生肖用midjounery-niji)
- Windows 内置下载工具
- javaScript 显示图片的例子