1. Download our Official Android App: Forums for Android!

Apps Start Activity from where it stops

Discussion in 'Android Development' started by ridoy, Oct 28, 2012.

  1. ridoy

    ridoy Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Jan 21, 2012

    Jan 21, 2012
    3
    0
    5
    I have 2 activity...suppose i name it activity A and activity B.When the application starts it shows activity A.Then after 5 seconds,it automatically switch to activity B.Activity B contains a listview and checkboxes with each item of listview.If user checks something then he press back button and returns to activity 1 page.All these works correctly.
    Now my problem is,activity A has a button to go again activity B page.When user press this button i want to start activity B from where it stops..that means the user will see what items he had checked earlier.Is it possible to view the activity B page from where it stops?
     

    Advertisement

  2. jonbonazza

    jonbonazza Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,930
    Joined:
    Jul 13, 2010

    Jul 13, 2010
    1,930
    457
    163
    Male
    Sure. Override the onPause method to save the state using something like SharedPreferences and then override the onResume method to restore this state.
     

Share This Page

Loading...