Android UsageStatsManager sample

Google has deprecated the function “getRecentTasks” of “ActivityManager” class. Now all it does is to get the list of apps that the current app has opened. But if you are writing app that “locks” access to specific apps with password or any other protection methods, you still need to be able to get top most activity/package to react accordingly to user changing current app and for example show your overlay.

Continue reading “Android UsageStatsManager sample”