0

我有一个问题:我有 3 个活动 (1 -> 2 -> 3)。他们每个人都开始另一个活动,例如:

Intent intent = new Intent(this, MainMenuActivity.class);
startActivity(intent);

但是当我在 3 个活动上按 BACK BUTTON 时 - 它会停止应用程序而不是将我移动到 2 个活动。我没有覆盖 onKeyDown 方法。会是什么?如何解决这个问题?

谢谢。

它对你说一些话吗?这是活动之间切换的流程:1 - 2- 3 - 2(黑屏)。

10-24 23:56:02.231: I/ActivityManager(237): Displayed com.example.runner/.StartActivity: +26s885ms
10-24 23:56:02.241: V/WindowManager(237): Starting animation in AppWindowToken{41b973c0 token=Token{40fdcf98 ActivityRecord{4128fb00 com.example.runner/.StartActivity}}} @ 79703124
10-24 23:56:02.241: V/WindowManager(237): Finished animation in AppWindowToken{41b973c0 token=Token{40fdcf98 ActivityRecord{4128fb00 com.example.runner/.StartActivity}}} @ 79703124
10-24 23:56:02.241: V/WindowManager(237): Starting animation in AppWindowToken{41a78ef8 token=Token{413e4ab0 ActivityRecord{412d8708 com.example.runner/.SportEventResultActivity}}} @ 79703124
10-24 23:56:02.321: D/memalloc(19422): /dev/pmem: Unmapping buffer base:0x522a7000 size:8355840 offset:6266880
10-24 23:56:02.321: D/memalloc(112): /dev/pmem: Freeing buffer base:0x4260a000 size:2088960 offset:6266880 fd:41
10-24 23:56:02.321: D/memalloc(19422): /dev/pmem: Unmapping buffer base:0x51ede000 size:2088960 offset:0
10-24 23:56:02.321: D/ActivityManager(237): destroyActivityLocked, r=ActivityRecord{412d8708 com.example.runner/.SportEventResultActivity}
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, dalvik.system.VMStack.getThreadStackTrace(Native Method)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, java.lang.Thread.getStackTrace(Thread.java:599)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.destroyActivityLocked(ActivityStack.java:3754)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.finishCurrentActivityLocked(ActivityStack.java:3621)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.finishCurrentActivityLocked(ActivityStack.java:3578)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.activityIdleInternal(ActivityStack.java:3410)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityManagerService.activityIdle(ActivityManagerService.java:4313)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:362)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1699)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, android.os.Binder.execTransact(Binder.java:338)
10-24 23:56:02.321: V/ActivityManager(237): destroyActivityLocked, dalvik.system.NativeStart.run(Native Method)
10-24 23:56:02.331: D/ActivityManager(237): destroyActivityLocked, r=ActivityRecord{412b3430 com.example.runner/.MainMenuActivity}
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, dalvik.system.VMStack.getThreadStackTrace(Native Method)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, java.lang.Thread.getStackTrace(Thread.java:599)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.destroyActivityLocked(ActivityStack.java:3754)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityStack.activityIdleInternal(ActivityStack.java:3422)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityManagerService.activityIdle(ActivityManagerService.java:4313)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:362)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1699)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, android.os.Binder.execTransact(Binder.java:338)
10-24 23:56:02.331: V/ActivityManager(237): destroyActivityLocked, dalvik.system.NativeStart.run(Native Method)
10-24 23:56:02.462: D/memalloc(112): /dev/pmem: Freeing buffer base:0x42010000 size:2088960 offset:0 fd:29
10-24 23:56:02.462: V/WindowManager(237): Finished animation in AppWindowToken{41a78ef8 token=Token{413e4ab0 ActivityRecord{412d8708 com.example.runner/.SportEventResultActivity}}} @ 79703354
4

0 回答 0