1

I have an Android service running in the background. Is it possible to be notified when a new app is being started and get the package name?

I could loop through the list of running apps every 10 seconds, but maybe there's a better way?

P.Henderson
  • 1,001
  • 2
  • 13
  • 23
  • [STICKY Service that tracks all of the running application](http://stackoverflow.com/questions/8061179/broadcast-receiver-to-detect-application-start) - be warned some parts of this are deprecated. You might want to do something on [these](https://developer.android.com/reference/android/app/usage/package-summary.html) lines instead. – Skynet Jan 23 '15 at 13:41
  • Thanks, however this is the same as I already have (checking every 10 seconds). I am looking for way to get an alert when someone starts an app. – P.Henderson Jan 23 '15 at 13:44
  • Android.app.usage won't work below lollipop. – P.Henderson Jan 23 '15 at 13:45
  • ^Yes that is true :) – Skynet Jan 23 '15 at 13:47

0 Answers0