我在 Android 上玩游戏时遇到问题:当我在游戏活动中按电源按钮停用屏幕然后唤醒手机时,我黑屏大约一分钟,然后应用程序崩溃。当我通过按主页按钮暂停活动然后返回游戏时,一切看起来都很好。
这是我在醒来后发现的关于我的应用程序的日志中唯一的入口:
12-11 18:27:18.187: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:18.442: WARN/WindowManager(19653): App freeze timeout expired.
12-11 18:27:18.442: WARN/WindowManager(19653): Force clearing freeze: AppWindowToken{40f140c8 token=Token{412d25e8 ActivityRecord{40eb01a0 pl.priv.robertszuba/pl.priv.mallwar.game.GameActivity}}}
12-11 18:27:20.212: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:20.512: WARN/ActivityManager(19653): Activity idle timeout for ActivityRecord{40eb01a0 pl.priv.robertszuba/pl.priv.mallwar.game.GameActivity}
12-11 18:27:20.737: DEBUG/dalvikvm(19653): GC_EXPLICIT freed 1532K, 46% free 9743K/17735K, paused 13ms+7ms
12-11 18:27:22.237: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:24.262: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:26.337: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:28.457: WARN/InputConnectionWrapper.ICC(19863): Timed out waiting on IInputContextCallback
12-11 18:27:54.107: DEBUG/dalvikvm(20893): GC_CONCURRENT freed 1788K, 32% free 6141K/8967K, paused 3ms+5ms
12-11 18:28:06.597: DEBUG/dalvikvm(19653): GC_CONCURRENT freed 1832K, 45% free 9805K/17735K, paused 3ms+5ms
当我尝试调试我的应用程序时,我看到它已正确暂停,并且在唤醒之后onResume
被调用并且一切onResume
都做得很好,但是没有onSurffaceCreate
调用它。