Is it possible to start an app in the background
Not really, but there is no obligation to show any UI once your app is started so that'd would look like you started in background. In fact it'd be perfectly safe to have all the setup done without any UI. Calling setContentView()
in your Activity's onCreate()
is not mandatory as is concluding your onCreate()
with ordinary finish()
. That way you can i.e. start Service
w/o showing any UI. There's even theme you can use with activity you do not want to display:
android:theme = "@android:style/Theme.NoDisplay"
For example, if a push notification is received, then the app is started in the background,
This is different story. Stop using Firebase's "automated" handling and process all pushes yourself. See How to handle notification when app in background in Firebase