views:

73

answers:

1

Hi,

Is it possible to make a service running in backgroud to be notified when an arbritary activity/application is started and ended by a user? I want to use it to log how often and for how long different applications are used in Android.

A: 

Is it possible to make a service running in backgroud to be notified when an arbritary activity/application is started and ended by a user?

No, sorry.

CommonsWare
I am new to android but I know there exists an Activity Stack where all running activities are. If it was possible to monitor this stack somehow, I think I would get the correct behaviour. But it seems that this stack is not fully available for developers. I have also seen that ActivityManager has some classes that provide information about running tasks, but I am unsure what an android task is, related to activites. I guess none of my suggestions would work, but if you could give a small explaination of why it would be very helpful :) Thank you
qtips