开发者

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" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜