Start Activity from where it stops


Last Updated:

  1. ridoy

    ridoy New Member This Topic's Starter

    Joined:
    Jan 21, 2012
    Messages:
    3
    Likes Received:
    0
    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 Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458
    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...