我公司开发的游戏andEngine这几乎是最后的。唯一的问题我现在面临的是,当在游戏中,如果电源按钮是pressed和游戏重新开始再次它从恒星。假设我玩6级和I pressed电源按钮时,游戏会恢复它会从1级开始任何一个可以帮助我?
I developed a game in andEngine which is almost final. Only problem I am facing now is that when during GamePlay if power button is pressed and Game is resumed again It starts from star. Suppose I am playing Level 6 and I pressed power button when the game will be resumed it will start from Level 1. Can any one help me with this?
您需要保存当前状态的onSaveInstanceState()并加载它 onRestoreInstanceState()。
You have to save current state in onSaveInstanceState() and load it in onRestoreInstanceState().
检查此链接: Android的活动
具体做法是:
活动周期 保存活动状态 Activity lifecycle Saving activity state上一篇:安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY上的Kindle Fire错误、INSTALL_FAILED_MISSING_SHARED_LIBRARY、Fire
下一篇:的ExceptionInInitializerError在Android应用程序?应用程序、ExceptionInInitializerError、Android