android - Is there a way to be aware of the execution of a 3rd party app? -


Actually, I have to figure out when another app starts, so I adjust my app in a special way Can i For example, if the user starts the Gmail app, then my service can detect and respond.

My current idea is getRunningTasks () from 'topActivity' Activity Manager class for each element. But it looks quite expensive because it has to be constantly tested in the background (and I am quite concerned about the use of my app's CPU).

If someone knows better, I like to hear it!

There is no way to do that "good way" which means that the broadcaster Do not Broadcast is the only way to start a service that checks out getRunningTasks () (you can also see which The app is on the background. I code if you are interested in that technology)

Check the service at intervals of 5-10 seconds its al Turn off service on SCREEN_OFF and restart it on SCREEN_ON

Sorry, but there is no other way for that.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -