Returns

Restore a state that was previously returned by saveInstanceState(). This
adds to the activity group information about all activity IDs that had
previously been saved, even if they have not been started yet, so if the
user later navigates to them the correct state will be restored.

Note: This does not change the current running activity, or
start whatever activity was previously running when the state was saved.
That is up to the client to do, in whatever way it thinks is best.

public
void
removeAllActivities()

Retrieve the state of all activities known by the group. For
activities that have previously run and are now stopped or finished, the
last saved state is used. For the current running activity, its
onSaveInstanceState(Bundle) is called to retrieve its current state.

Returns

a Bundle holding the newly created state of all known activities

See Also

Start a new activity running in the group. Every activity you start
must have a unique string ID associated with it -- this is used to keep
track of the activity, so that if you later call startActivity() again
on it the same activity object will be retained.

When there had previously been an activity started under this id,
it may either be destroyed and a new one started, or the current
one re-used, based on these conditions, in order:

If the Intent maps to a different activity component than is
currently running, the current activity is finished and a new one
started.

Warning: There is an issue where, if the Intent does not
include an explicit component, we can restore the state for a different
activity class than was previously running when the state was saved (if
the set of available activities changes between those points).

Parameters

id

Unique identifier of the activity to be started

intent

The Intent describing the activity to be started

Returns

Returns the window of the activity. The caller needs to take
care of adding this window to a view hierarchy, and likewise dealing
with removing the old window if the activity has changed.