微信支付问题:WeChatNotifyActivity} did not call finish() prior to onResume() completing
来源:互联网 发布:淘宝金冠店多少 编辑:程序博客网 时间:2024/05/18 08:04
在前人留的工程项目中进行渠道替换对接支付,使用的微信支付,但是以前一直都是通过现在支付把微信支付进行了融合,而且只有微信支付,(现在支付是一个集成了支付宝,微信,百度金融,京东金融等平台的聚合类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 instrumentation mInstrumentation.callActivityOnResume(this); if (!mCalled) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + " did not call through to super.onResume()"); } // invisible activities must be finished before onResume() completes if (!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() completes if (!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
- android 6.0+ java.lang.IllegalStateException did not call finish() prior to onResume() completing
- Activity did not call finish() prior to onResume() completing原因和解决办法
- "did not call through to super.onResume"问题解决
- did not call through to super.onCreate()
- did not call through to super.onDestroy()
- 五、android.app.SuperNotCalledException did not call through to supper onCreate()的问题
- SuperNotCalledException did not call through to supper onCreate();
- AndroidRuntime: did not call through to super.onCreate()
- 解决did not call through to super.onDestroy()
- grade中在线添加依赖无效不下载的问题和.MainActivity did not call through to super.onCreate()
- Unable to destroy activity did not call through to super.onDestroy()
- android.app.SuperNotCalledException: Activity {} did not call through to super.onPause()
- android.app.SuperNotCalledException:did not call through to super.onXX() 异常处理
- android.app.SuperNotCalledException: Activity {} did not call through to super.onDestory() 解决办法
- android.util.SuperNotCalledException: Activity did not call through to super.onDestroy()异常的解决
- xxxActivity did not call through to super.onStart()等方法SuperNotCalledException的源码分析
- 数据结构入门学习系列-3(线性表的顺序存储)
- 最大公约数、最小公倍数
- JAVA IO:RandomAccessFile
- Java-NIO-网络通信-阻塞
- 自定义View之一加天气中的6日温度折线图
- 微信支付问题:WeChatNotifyActivity} did not call finish() prior to onResume() completing
- mybatis中javaType和jdbcType对应关系
- 不可见字符会引起的java.lang.NumberFormatException: For input string: "15"
- CocoaPods安装使用
- Spring Bean的生命周期之我的理解(一)------BeanFactoryPostProcessor和BeanPostProcessor
- 故障转移群集概述
- git使用
- 除了区块链和比特币,这些技术成果正在改变世界
- Android开发60条技术经验总结