java.lang.Object | |
↳ | android.app.ActivityManager |
Interact with the overall activities running in the system.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ActivityManager.MemoryInfo | Information you can retrieve about the available memory through
getMemoryInfo(ActivityManager.MemoryInfo) . |
||||||||||
ActivityManager.ProcessErrorStateInfo | Information you can retrieve about any processes that are in an error condition. | ||||||||||
ActivityManager.RecentTaskInfo | Information you can retrieve about tasks that the user has most recently started or visited. | ||||||||||
ActivityManager.RunningAppProcessInfo | Information you can retrieve about a running process. | ||||||||||
ActivityManager.RunningServiceInfo | Information you can retrieve about a particular Service that is currently running in the system. | ||||||||||
ActivityManager.RunningTaskInfo | Information you can retrieve about a particular task that is currently "running" in the system. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RECENT_WITH_EXCLUDED | Flag for use with getRecentTasks(int, int) : return all tasks, even those
that have set their
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the device configuration attributes.
| |||||||||||
Return the approximate per-application memory class of the current
device.
| |||||||||||
Return information about the memory usage of one or more processes.
| |||||||||||
Returns a list of any processes that are currently in an error condition.
| |||||||||||
Return a list of the tasks that the user has recently launched, with
the most recent being first and older ones after in order.
| |||||||||||
Returns a list of application processes that are running on the device.
| |||||||||||
Returns a PendingIntent you can start to show a control panel for the
given running service.
| |||||||||||
Return a list of the services that are currently running.
| |||||||||||
Return a list of the tasks that are currently running, with
the most recent being first and older ones after in order.
| |||||||||||
Returns "true" if the user interface is currently being messed with
by a monkey.
| |||||||||||
Have the system immediately kill all background processes associated
with the given package.
| |||||||||||
This method is deprecated.
This is now just a wrapper for
killBackgroundProcesses(String) ; the previous behavior here
is no longer available to applications because it allows them to
break other applications by removing their alarms, stopping their
services, etc.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Flag for use with getRecentTasks(int, int)
: return all tasks, even those
that have set their
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
flag.
Get the device configuration attributes.
Return the approximate per-application memory class of the current device. This gives you an idea of how hard a memory limit you should impose on your application to let the overall system work best. The returned value is in megabytes; the baseline Android memory class is 16 (which happens to be the Java heap limit of those devices); some device with more memory may return 24 or even higher numbers.
Return information about the memory usage of one or more processes.
pids | The pids of the processes whose memory usage is to be retrieved. |
---|
Returns a list of any processes that are currently in an error condition. The result will be null if all processes are running properly at this time.
Return a list of the tasks that the user has recently launched, with the most recent being first and older ones after in order.
maxNum | The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many tasks the user has started and the maximum number the system can remember. |
---|
SecurityException | Throws SecurityException if the caller does
not hold the GET_TASKS permission.
|
---|
Returns a list of application processes that are running on the device.
Returns a PendingIntent you can start to show a control panel for the given running service. If the service does not have a control panel, null is returned.
SecurityException |
---|
Return a list of the services that are currently running.
maxNum | The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many services are running. |
---|
SecurityException |
---|
Return a list of the tasks that are currently running, with the most recent being first and older ones after in order. Note that "running" does not mean any of the task's code is currently loaded or activity -- the task may have been frozen by the system, so that it can be restarted in its previous state when next brought to the foreground.
maxNum | The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many tasks the user has started. |
---|
SecurityException | Throws SecurityException if the caller does
not hold the GET_TASKS permission.
|
---|
Returns "true" if the user interface is currently being messed with by a monkey.
Have the system immediately kill all background processes associated with the given package. This is the same as the kernel killing those processes to reclaim memory; the system will take care of restarting these processes in the future as needed.
You must hold the permission
KILL_BACKGROUND_PROCESSES
to be able to
call this method.
packageName | The name of the package whose processes are to be killed. |
---|
This method is deprecated.
This is now just a wrapper for
killBackgroundProcesses(String)
; the previous behavior here
is no longer available to applications because it allows them to
break other applications by removing their alarms, stopping their
services, etc.