I'm new to android and I'd like to develop simple game.
I have read about the Activity lifecycle on the official android site and also here on stackoverflow, but I need a little help with pausing/resuming the game :-/
I had expected some scenerio similar to the lifecycle diagram, but when I lock the screen, method Activity.onDestroy()
is also called, but then onCreate()
is called again. I am confused as onRestart()
is not being called!
I know about the problem with screen orientation, and have added android:screenOrientation="landscape"
which was supposed to help.
I'm happy with the other game mechanics such as animating, colisions etc, which are well described on the internet, but I can't manage pausing/resuming.
Could someone recommend a comprehensive tutorial or give a code example? Anything covering how to build the skeleton of simple game, which can be paused, saved, etc would be much appreciated.
thanks a lot