Reputation: 832
For instance by registering as a receiver of some intent. I realize that the OS won't tell my app, and that's fine, I'm not expecting that. I am, however, expecting to be able to register something on the OS level to receive these sorts of broadcasts. They end up in logcat, so presumably they should be something you can subscribe to. Are they?
Upvotes: 0
Views: 86
Reputation: 39807
The only way to do this is if you have the device firmware signing key. There is a permission, android.permission.SET_ACTIVITY_WATCHER
, which lets you install a callback to be notified but the permission is only granted if your APK has that signature.
Short of that you could poll the system to see what activities are active but that would be time consuming / battery wasting.
Upvotes: 1