For a project, I need something like a generic flexible lifecycle engine. What I mean is, I should be able to register a number of components with it. The components should be triggered on different app/activity lifecycle events.
For example:
- component A reacts to onStart(), onStop() and onDestroy()
- component B reacts to onStart() and onPause()
In addition components should be able to react to other components/events.
For example:
- component C gets triggered when components A and B have finished a specific task
Before I start to write something myself, I wanted to check if there is already a library out there that can do such things.
You can create your custom Application class extending Android
Application
class. Next, you can create and register ActivityLifecycleCallbacks. After that, you can implement your logic inside the callbacks.