Skip to content Skip to sidebar Skip to footer

Foreground Service Is Killed In Android 10

In Android 10, some manufacturer comes with the new feature in a battery optimization setting (see the picture). My foreground service getting killed by OS after some time when the

Solution 1:

I was getting the same problem, in my case the service gets location in background so, I have to add foregroundServiceType and it works fine. https://developer.android.com/about/versions/10/privacy/changes#app-access-device-location

android:foregroundServiceType="location"

Post a Comment for "Foreground Service Is Killed In Android 10"