Performing stop of activity that is not resumed

来源:互联网 发布:python 硬件自动化测试 编辑:程序博客网 时间:2024/06/11 06:01

Performing stop of activity that is not resumed: {com.uniscope.myfile/com.uniscope.myfile.FileExplorerTabActivity}                                                 java.lang.RuntimeException: Performing stop of activity that is not resumed: {com.uniscope.myfile/com.uniscope.myfile.FileExplorerTabActivity}                                                     at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3344)                                                     at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3425)                                                     at android.app.ActivityThread.access$1100(ActivityThread.java:151)                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)                                                     at android.os.Handler.dispatchMessage(Handler.java:102)                                                     at android.os.Looper.loop(Looper.java:135)                                                     at android.app.ActivityThread.main(ActivityThread.java:5254)                                                     at java.lang.reflect.Method.invoke(Native Method)                                                     at java.lang.reflect.Method.invoke(Method.java:372)                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)


是因为在Activity A 中在oncreate中启动了另一个activity B,而这个Activity A没有走完Activity的生命流程(oncreate->onstart->onstop)所以会报错。

这种情况可以选择使用handler机制在oncreate中发送个message给handler启动另外一个活动。

本文参考了http://blog.csdn.NET/sinat_29962405/article/details/50976116

阅读全文
5 0