pause is called, when your app looses focus. On Android this happens, if you press the home button or a call is incoming.
When you return to the app,
resume gets called.
So if you switch from
MenuScreen inside the
pause method, and switch from
Gamescreen inside the
MenuScreen will never show, as it is active only when your app is in background.
What you might want to do is to switch to
pause, but on
resume don't switch back. Instead you should wait till the user presses a button
Continue and then go back to the
Also, you should not call
resume yourself, those are methods called by the framework in specific situations.
I also noticed, that you call
show method inside the
resume method. The method
show is another method, used by the framework. It is usually called, when you switch
setScreen in the
Game class calls
hide for the current
show for the new
render method should generally not be called by you. The
Game class automatically calls the
render of the current
Screen in it's own
render. So if you set the right
Screen, the right
render method will be called.
A possible approach for you might be the following:
pause method, save the game data, as it is possible, that the user closes the app (or Dalvik decides to close it cuase the system needs the ressources). You can also call
setScreen(menuScreen) here. This call will result in a call to
actionGame.hide(), where you might release some of the ressources used by the
GameScreen. Then it will call
menuScreen.show() where you might load ressources needed by the
When you return to the app
menuScreen.resume() will be called. You don't need to do anything here. Instead you should waint, till the menu button
Continue is pressed. Here you can load the saved data and the