Does Android broadcast when an app is opened?

android, broadcast

Solution

In adroid, is there any broadcast when some app is opend?

No, for obvious privacy reasons.

Problem

For example, if I want to know when Youtube is opened, is there any broadcast associated with it? I know of course I can poll the logcat message to check the activity. But can I do it through broadcast since it will be much less power-hungry. This link seems to indicate it is impossible:< How to Track App Usage in Android? How to detect when an activity is launched?

Original source

Related problems