My first thought was that the provider would implement the activity lifecycle callback. So I would just have one line to register it.
However, when you have multiple of them, maybe this is better so you can control the order of the calls or what is the intent?
Yeah the general idea here is that this ensures you add an activity to a specific activity stack, rather than starting it from a random live activity or from the application context which isn't tied to a specific activity stack.
I don't get your blog post to start an activity you don't have to have an activity right? a context is enough as it is possible to call context.startActivity
Starting an activity from the Application class isn't the same as starting it from an activity. When using the application class the activity manager doesn't know which activity stack the new activity should be added to.
Eugen Martynov
Android and more
My first thought was that the provider would implement the activity lifecycle callback. So I would just have one line to register it.
However, when you have multiple of them, maybe this is better so you can control the order of the calls or what is the intent?