Will the Android OS kill my IntentService under normal circumstances?
-
27-10-2019 - |
Question
Will the Android OS kill my IntentService
under normal circumstances or do I need to worry about any variables being reset?
Solution
Will the Android OS kill my IntentService under normal circumstances
Yes. IntentServices will be paused,stopped and destroyed when there are no waiting intents at the whim of the OS.
do I need to worry about any variables being reset?
There are no guarantees about variable values being retained. You should use onCreate to configure the initial state of the service and, in my experience, it works best if you don't maintain state outside of the lifecycle of the service.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow