'Some Os are killing Foreground service is it normal or exception?
My app is working fine in many devices but in few devices os is killing it I want to know is it normal or exception and how to resolve it?
Solution 1:[1]
Are these being started whilst the app is in the background? If so you can only start a foreground service from the background in some special use cases. The docs state that the thing to do here is use Work Manager instead.
As the Android OS is customized by different hardware manufacturers (e.g. Samsung etc) then its possible that services get killed off for various reasons - most likely to be battery saving related.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tom Ford |
