0

I want to know (with user's permissions) when few specifics apps / activities where activated by the user, e.g. user open Gmail app.

Currently I'm doing it by ActivityManager.getRunningTasks periodically, but it’s not a good solution. Any ideas how to do it better?

Arnold
  • 323
  • 2
  • 15
  • 1
    Some apps like gmail have content providers but the information they provide is determined by the app's makers. They may not provide the exact information you want. – TTransmit Dec 30 '14 at 08:58
  • Thanks, I know that option, but its not what I need. Ideally, I need event: App x was opened with Activity Y – Arnold Dec 30 '14 at 09:08
  • Even an event of: "some app was started" will be good, with no more detailes, and then I can check getRunningTasks – Arnold Dec 30 '14 at 11:37
  • 1
    http://stackoverflow.com/questions/7596488/android-listen-for-app-launch suggests it is not possible. It uses `ActivityManager.getRunningAppProcesses()`. I guess the issue is draining the battery. I wonder if the check could only be running when the phone is active. For example when the screen is on, http://stackoverflow.com/a/9478013/2832027 – TTransmit Dec 30 '14 at 11:57
  • Thnaks TTransmit, Its not what I want but if no other option is avaliable its much better ro check only when scren is on. – Arnold Dec 30 '14 at 15:00

0 Answers0