0

I use getRunningTasks to get running task, but it always return com.android.launcher.

I search and found same problem with link: getRunningTasks doesn't work in Android L

But it don't have solution.

Please help.

Thank you!

Community
  • 1
  • 1
Tho Tran
  • 71
  • 5

1 Answers1

1

Quoting the documentation (which I would link to, but it is only in a ZIP archive...):

This method is deprecated. As of L, this method is no longer available to third party applications: the introduction of document-centric recents means it can leak person information to the caller. For backwards compatibility, it will still retu rn a small subset of its data: at least the caller's own tasks, and possibly some other tasks such as home that are known to not be sensitive.

Hence, the solution is to find some other solution for whatever problem you were trying to solve with getRunningTasks().

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Do you know other method to get current running app? App Lock of CM security can do it. – Tho Tran Sep 13 '14 at 07:35
  • @ThoTran: "Do you know other method to get current running app?" -- no. "App Lock of CM security can do it." -- CyanogenMod is not using the L Developer Preview. – CommonsWare Sep 13 '14 at 11:33