0

Hey guys I have this activity flow on my game. Start page>List of stages(from stages 1-10)>questions. If the user press the start button on the start page he will go to the list of stages, from there the only button that is enabled is stage 1 then the rest are in disable mode. In stage 1 there are 5 questions and after the user finish answering them correctly, the user will be directed back to the list of stages in which stage 2 is already unlocked as well as stage 1(stage 1 is enabled in default). Now what I want to happen is when the user exits the application using home button or back button then the user open the application again, after pressing the start button from start page he will be directed to the list of stages in which the stage 2 is still unlocked or any stages the user last finished.

Jerome
  • 79
  • 1
  • 8
  • Explain your problem in small, precise.. – Ajay S Jan 31 '13 at 14:56
  • 1
    ...and with some whitespace – Simon Jan 31 '13 at 14:57
  • sorry for that. Well the main question of these is How can I resume(I don't know if the term "Resume" is correct) the last activity that I finished? for example I already unlocked stage2 or whatever stage, If I closed my application and upon returning, stage 2 should still be unlocked or whatever stages the user unlocked. – Jerome Jan 31 '13 at 15:06
  • You want to open the last activity again when user start the app. right – Ajay S Jan 31 '13 at 15:10
  • @TGMCians yes that's exactly what I want to happen. if the user unlocked stage 2 and decided to quit the game, by the time he relaunch it again, after pressing start button, the stage 2 should be unlocked – Jerome Feb 05 '13 at 12:00

1 Answers1

1

As I don't understand fully your questions I have two propositions:

  1. Save stage info in onPause or onStop and then retrieve it in onCreate method (http://developer.android.com/guide/components/activities.html#Lifecycle), or
  2. Save everything in onStop in SharedPreferneces and retrieve when needed. I suppose this option is better.
sebap123
  • 2,541
  • 6
  • 45
  • 81