tags:

views:

29

answers:

1

Hi I am new to Blackberry. I am developing a Quizz application having a HomeScreen and subsequent screens.My requirement is after user exit the application in the middle of the application the user is able to continue the test where he stopped. For that I used a ResumeButton on the HomeScreen whish should display even after closing the application user wants to continue the test. Any solution appreciated..Plese specify any code snippet.Thanks in advance.

A: 

You need to think about your idea of "state" -- save state when the user exits, and then use the saved state to display the proper screen when the app starts.

At the most abstract, your code will resemble this:

  static void main(String[] args) {
    // create UI App
    customUiApp = new customUiApp();

    // read stored state - is there any?

    if (oldState) {
       // unserialize current test object

       // launch test screen with test object
    } else {
       // launch default homescreen
    }
    cutomUiApp.enterEventDispatcher();
}

I hope this gives you a framework for thinking about your problem-- you need to look up using the persistable store to decide how you want to store your state.

cjp