Home 键导致 AndEngine 中出现许多 Game 实例
当我玩游戏时按下Home键。视图消失了,这是正常的,但是当我再次开始游戏时,会开始一个新游戏,之前的游戏不会恢复,这会导致很多问题,有人可以帮助我解决这个问题吗?
when I am playing the game and I press the Home Key. The view is gone which is normal but when I start the game again a new game is started previous game is not resumed which is causing a lot of problem can any one help me with this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这样做解决了我的问题
Doing this solved my problem
将
android:configChanges="keyboardHidden|orientation"
添加到 AndroidManifest 中的 Activityadd
android:configChanges="keyboardHidden|orientation"
to your activity in AndroidManifest您可能正在 onResume 方法中创建游戏的新实例,因此请检查所有生命周期方法。
You are probably creating a new instance of the game in an onResume method, so check all your lifecycle methods.