I want to restart the service after the activity is destroyed.
In the service is a database-reference to a firebase-db. The purpose of this service is to show a notification to the user, if a child was added.
My Manifest.xml looks as follow:
<application>
[...]
<service
android:name=".FirebaseComponent.FirebaseDatabasePushService"
android:process=":PushService"
android:enabled="true"
android:exported="false" />
</application>
I tried to use public void onTaskRemoved(Intent rootIntent)
and inside a startService(intent) but that didn't worked either.
My onStartCommand(Intent intent, int flags, int startId)
returns START_STICKY.
How do I achieve, that the service is restarted after the user killed it?