0

当我按一次返回按钮时,应用程序退出就好了。但是当我反复快速地按下 [Back] 按钮时,应用程序崩溃了(参考附加的堆栈跟踪)。即使没有执行任何片段事务也会发生。有办法治愈吗?

04-06 05:41:50.436: E/AndroidRuntime(2352): FATAL EXCEPTION: main
04-06 05:41:50.436: E/AndroidRuntime(2352): java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1327)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:475)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java:174)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.app.Activity.onKeyUp(Activity.java:2145)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.view.KeyEvent.dispatch(KeyEvent.java:2633)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.app.Activity.dispatchKeyEvent(Activity.java:2375)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1847)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3701)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.view.ViewRootImpl.handleImeFinishedEvent(ViewRootImpl.java:3651)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2818)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.os.Looper.loop(Looper.java:137)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at android.app.ActivityThread.main(ActivityThread.java:5041)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at java.lang.reflect.Method.invokeNative(Native Method)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at java.lang.reflect.Method.invoke(Method.java:511)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-06 05:41:50.436: E/AndroidRuntime(2352):     at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

0

只要弄清楚我的愚蠢错误。我super.onStop()在覆盖活动时打电话onPause()

于 2013-04-09T03:56:54.137 回答