So, if I want a long running process (logging GPS points over several hours), I would need to use START_STICKY and then maintain some knowledge of state between service restarts. That is, save state to disk (filename that I am writing to, specifically). And since onDestroy is not called and there is no other warning that the service is about to end, I can't use any kind of buffered file writer because I can't guarantee that the buffer is written and I can't know to call flush.
Am I understanding this correctly? And thanks Kostya for the info and very useful link. Thanks! On Wednesday, May 9, 2012 11:35:15 AM UTC-7, Dianne Hackborn wrote: > > That is the expected behavior. The longer your service runs, the more > likely it is to be killed (and then restarted if you asked for it to be > sticky). > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en