I am trying to build an application in which a service can check whether an external application is running at foreground or not.
For example, when we enter in Google Chrome, this service automatically detects what package has been executed and reacts in one way or another.
- It's that even possible?
- I have heard about 'getRunningTasks' method but is deprecated on new Android versions
Any suggestion is appreciated.