Will the Android OS kill my IntentService under normal circumstances or do I need to worry about any variables being reset?
Will the Android OS kill my IntentService under normal circumstances or do I need
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. IntentServices will be paused,stopped and destroyed when there are no waiting intents at the whim of the OS.
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.