开发者

ActivityManager.getRecentTasks() returns 0 results

update I've tried this on a 1.6 AVD and a real Droid Incredible. Both have the same issue.

I need to get a list of recent tasks, but ActivityManager.getRecentTasks() always returns 0 results and can't figure out 开发者_如何学JAVAwhy.

ActivityManager result = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
ArrayList<RecentTaskInfo> apps = (ArrayList<RecentTaskInfo>) result.getRecentTasks(10, ActivityManager.RECENT_WITH_EXCLUDED);

I've set android.permission.GET_TASKS in the manifest but apps is always 0.

Anyone have insight in to why? I'm stumped.


Apparently it was that I needed to clean the project. Once I cleaned the project, it worked.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜