Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' method gets called?
Let's assume you are talking explicitly about starting the Service, not binding to it: If a Service is started by some other component, it needs to be explicitly stopped, either by the same component, an other component or by the Service itself (stopSelf). If the process contains both your Service and your components that can start or stop the Service, your Service's onDestroy will not get called. As far as I can tell, this would violate the contract between the user(s) of Service and the Service itself. When your Activity (app) goes to the background, the entire process could get killed at some point (especially, for example, if you have a Service running that uses a lot of resources causing your entire app to be resource heavy). But that means that both your Activity and Service get really killed (process killed) at the same time. On Tuesday, January 6, 2015 11:49:50 AM UTC-5, Oleksii Bieliaiev wrote: > > Found some info here > <http://stackoverflow.com/questions/8087596/when-service-is-killed-can-the-process-be-still-alive?lq=1> > > > > On Tuesday, November 25, 2014 12:08:18 PM UTC+1, Oleksii Bieliaiev wrote: >> >> Hey guys, >> >> let's imagine we have an app with a service and an activity inside. Both >> components live in a same process, our service is started (in terms of >> Android) and a user does some interaction with an activity. Eventually our >> app goes to background. My question is, whether is it possible, under >> certain conditions (low memory, timeout, etc), that Android "kills" our >> started service separately, without killing entire process? >> >> Thank you, >> Alex >> > -- 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.