I am developing a game using libgdx framework. I want to raise a dialogue when I pause the game, and on that dialogue I want to use a resume button. I know that I should use pause() and resume() methods, but I’m not able to understand what I should write in those methods.
Any help would be apprechiated.
My code:
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
I think you are confused, the pause and resume states indicated in your call back functions have nothing to do with your game or whether the game is ‘Playing’. These calls are used when the OS decides to suspend the application for some reason.
A quick look at the android developers documentation will help you with these ‘lifetime’ issues – on the other hand you need to implement your own pause and resume logic in the game in some way.