Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialpraveen
11,314 Points52 sec to restart
Will all types of services(start_sticky, start_non_sticky and start_rediliver_intent) have delay in restarting. It is 52 seconds in the example. If its a music player service, this delay will make a lot of difference to the user.
Cant the service be kept alive when the process is killed instead of restarting it?
1 Answer
Ben Deitch
Treehouse TeacherNope. The process contains the service; killing the process kills the service.
You really don't need to worry that much about the delay. If you designate your service as a foreground service, its process will be one of the very last processes to be killed in a low memory situation; and at that point you have bigger problems to deal with :). Also, low memory situations just aren't that frequent on a lot of newer devices.