Trying to fetch all running tasks in android?
I am trying to fetch all the currently running apps and i am trying to do it like this:
try
{
List<ActivityManager.RunningAppProcessInfo> tasks = am.g开发者_StackOverflow中文版etRunningAppProcesses();
}
catch (SecurityException e)
{
//Something
}
But every time i am trying to run it on emulator it's giving me force close error message.
It need permission to be set in the AndroidManifest.xml:
<uses-permission android:name="android.permission.GET_TASKS" />
精彩评论