I am looking for a way to listen for starting applications/activities. I guess many of You know the application "Tasker" which achieves exactly that. If a chosen applications gets launched, a specific task starts.
Now I wonder how to achieve that? I could start a Service, but which method should I use?
I noticed that Tasker asks for a permission before using this method. The application redirects me to the Accessibility Settings tab where I can enable Tasker with the notification: "Tasker wants permission to: Monitor your actions - Allows TalkBack to know when you are using an app"
Any suggestions?
Edit:
I found out that an AccessibilityService is used. Now my problem is, how do I specify all installed packages to this Service? I know that it's possible to specify packages one by one but how do I select all?