java.lang.Object | |
↳ | android.app.LocalActivityManager |
This class was deprecated
in API level 13.
Use the new Fragment
and FragmentManager
APIs
instead; these are also
available on older platforms through the Android compatibility package.
Helper class for managing multiple running embedded activities in the same
process. This class is not normally used directly, but rather created for
you as part of the ActivityGroup
implementation.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new LocalActivityManager for holding activities running within
the given parent.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Destroy the activity associated with a particular id.
| |||||||||||
Restore a state that was previously returned by
saveInstanceState() . | |||||||||||
Called by the container activity in its
onDestroy() so
that LocalActivityManager can perform the corresponding action on the
activities it holds. | |||||||||||
Called by the container activity in its
onPause() so
that LocalActivityManager can perform the corresponding action on the
activities it holds. | |||||||||||
Called by the container activity in its
onResume() so
that LocalActivityManager can perform the corresponding action on the
activities it holds. | |||||||||||
Called by the container activity in its
onStop() so
that LocalActivityManager can perform the corresponding action on the
activities it holds. | |||||||||||
Return the Activity object associated with a string ID.
| |||||||||||
Retrieve the Activity that is currently running.
| |||||||||||
Retrieve the ID of the activity that is currently running.
| |||||||||||
Remove all activities from this LocalActivityManager, performing an
onDestroy() on any that are currently instantiated. | |||||||||||
Retrieve the state of all activities known by the group.
| |||||||||||
Start a new activity running in the group.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new LocalActivityManager for holding activities running within the given parent.
parent | the host of the embedded activities |
---|---|
singleMode | True if the LocalActivityManger should keep a maximum of one activity resumed |
Destroy the activity associated with a particular id. This activity will go through the normal lifecycle events and fine onDestroy(), and then the id removed from the group.
id | Unique identifier of the activity to be destroyed |
---|---|
finish | If true, this activity will be finished, so its id and all state are removed from the group. |
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.
state | a previously saved state; does nothing if this is null |
---|
Called by the container activity in its onDestroy()
so
that LocalActivityManager can perform the corresponding action on the
activities it holds.
Called by the container activity in its onPause()
so
that LocalActivityManager can perform the corresponding action on the
activities it holds.
finishing | set to true if the parent activity has been finished; this can be determined by calling Activity.isFinishing() |
---|
Called by the container activity in its onResume()
so
that LocalActivityManager can perform the corresponding action on the
activities it holds.
Return the Activity object associated with a string ID.
Retrieve the Activity that is currently running.
Retrieve the ID of the activity that is currently running.
Remove all activities from this LocalActivityManager, performing an
onDestroy()
on any that are currently instantiated.
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.
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:
FLAG_ACTIVITY_SINGLE_TOP
flag set, then the current
activity will remain running and its
Activity.onNewIntent()
method
called.
FLAG_ACTIVITY_CLEAR_TOP
set, then the current activity
will remain running as-is.
If the given Intent can not be resolved to an available Activity,
this method throws ActivityNotFoundException
.
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).
id | Unique identifier of the activity to be started |
---|---|
intent | The Intent describing the activity to be started |
ActivityNotFoundException |
---|