Under some conditions, my application gets started by calling one of
my Broadcast-Receivers
or Services
(etc), but I want to prevent the
component that is used for the intent to get started.
Why: Because I need to do some prior initialization work do run, before any component should start. But this work can be a long running thing, therefore I can not just execute it inside of my application subclass on the main thread.
I am subclassing the Application
in my app. Therefore my approach would be
to somehow intervent the intent in the onCreate()
of my application subclass and
instead, start a specific service of mine, which runs the prior-initialization
and re-calls the intent, that was intentionally used after that.
Can you image any possibly do get this done? Thank you!
Ps.: I have a lot components that could possibly start my application. I do not want to include my condition-code inside of every component.