Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

There are a lot of articles about how to save a state of a game and they are pretty good. But I have one conceptual misunderstanding where should I save the state?

My game has number of screens and pair of them are MainMenuScreen and MainSceneScreen these are inherited from Screen class. MainMenuScreen is shown at start of the game the MainSceneScreen little later.

What is the problem? I navigated to MainSceneScreen, forced Android to stop the application (I change a language settings on the device to achieve it, please let me know if I'm wrong). After that I select the application again and I can see MainMenuScreen is shown. But I want MainSceneScreen to be shown.

I suppose I should override resume method. But what class I should override? I have class PsGame that extends Game class of libgdx. I put breakpoints to its resume method and it turned out that method was not called. I investigated the problem and I've found little strange code in onResume method of AndroidApplication class of libgdx:

    if (!firstResume)
        graphics.resume();
    else
        firstResume = false;

My debugger said firstResume was true and didn't go to *graphics.resume()*line.

Sorry for a lot of words but could you answer following question:

  1. What did I do wrong?
  2. What methods should I override?

Thank you in advance.

share|improve this question
1  
I overrid resume() in the class tha extends Game in libgdx, and when i press the home button and enter the app again it executes and it enters that method –  Rudy_TM Jul 23 '12 at 7:58
1  
@Rudy_TM You should post this as an answer. –  Laurent Couvidou Sep 14 '12 at 15:21

1 Answer 1

I override resume() in the class tha extends Game in libgdx, and when i press the home button and enter the app again it executes and it enters that method.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.