Best code examples for Android ActivityManager class (android.app.ActivityManager)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ActivityManager class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ActivityManager examples from Open Source projects
This code example shows how to use the following methods: getMemoryInfo
49:	am.getMemoryInfo(outInfo); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMemoryInfo
32:	activityManager.getMemoryInfo(fetchedMemoryInfo); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMemoryInfo
49:	am.getMemoryInfo(outInfo); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getRunningTasks
35:	List<RunningTaskInfo> tasks = am.getRunningTasks(1); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getRunningTasks
298:	List<RunningTaskInfo> tasks = am.getRunningTasks(2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getRunningTasks
19:	List<RunningTaskInfo> tasks = am.getRunningTasks(1); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDeviceConfigurationInfo
51:	ConfigurationInfo info = am.getDeviceConfigurationInfo(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDeviceConfigurationInfo
102:	ConfigurationInfo info = am.getDeviceConfigurationInfo(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDeviceConfigurationInfo
39:	ConfigurationInfo info = am.getDeviceConfigurationInfo(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMemoryClass
206:	int memoryClass = activityManager.getMemoryClass(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMemoryClass
40:	return am.getMemoryClass(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getMemoryClass
137:	report.append("Memory Class: " + activityManager.getMemoryClass() + "\n"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getRecentTasks, getRunningAppProcesses, getRunningServices
64:	runningInfoList = am.getRunningAppProcesses(); 
65:	runningServiceInfoList = am.getRunningServices(MAX_RUNNING); 
66:	recentTaskInfos = am.getRecentTasks(MAX_RUNNING, 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDeviceConfigurationInfo, getLargeMemoryClass, getMemoryClass
109:	Log.i(TAG, String.format("Memory class: %d MB", activityManager.getMemoryClass())); 
-
111:	String.format("Large memory class: %d MB", activityManager.getLargeMemoryClass())); 
-
113:	ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getLargeMemoryClass
19:	int memoryClass = am.getLargeMemoryClass(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: restartPackage
23:	am.restartPackage(pkg); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getMemoryInfo, getProcessMemoryInfo
60:	activityManager.getMemoryInfo(memInfoSystem); 
61:	MemoryInfo[] memInfoProc = activityManager.getProcessMemoryInfo(myPidArray); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getProcessMemoryInfo
273:	MemoryInfo[] memInfo = activityMgr.getProcessMemoryInfo(processPID); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: killBackgroundProcesses, restartPackage
39:	activityMgr.restartPackage(packName); 
-
41:	activityMgr.killBackgroundProcesses(packName); 
Full Snippet Info
6
CodeRank
Examples for other Android ActivityManager methods:
Related Android ActivityManager Questions & Answers:
ActivityManager Class Overview
...
Methods
  • getLargeMemoryClass
    Return the approximate per-application memory class of the current device when an application is running with a large heap.
  • getMemoryClass
    Return the approximate per-application memory class of the current device.
  • getMemoryInfo
    Return general information about the memory state of the system.
  • getRecentTasks
    Return a list of the tasks that the user has recently launched, with the most recent being first and older ones after in order.
  • getRunningTasks
    Return a list of the tasks that are currently running, with the most recent being first and older ones after in order.
  • killBackgroundProcesses
    Have the system immediately kill all background processes associated with the given package.
  • restartPackage
    This method was deprecated in API level 8. 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.