Announcements

Help Wizard

Step 1

NEXT STEP

Spotify preview background service is not always stopped properly

Spotify preview background service is not always stopped properly

Spotify 0.5.0.972.g8fe0a0d2

 

What is the logic for when the background service is stopped? Is there a timeout or some other criteria? 

 

I've seen it get stopped properly, gone from the Running tab in Settings -> Apps. But currently the service has been running for 4 hours even though it was over 2 hours since I stopped playback. I have not used the Spotify app since then either. 

 

Playback was stopped because the battery on my bluetooth headset ran out. Perhaps there's a code path there somewhere where stopSelf/stopService isn't called? 

Reply
2 Replies

Android performs it's own app management functions - deciding when to push old apps out of memory depending on what newer apps are requiring

----------------
Listening on Windows, Android and Sonos. Tweeting it at @davelicence

Unless the app uses a Service which is the Android way for an app to tell the system that it is doing important stuff for the user in the background and must NOT be killed. Because of this it is essential to ensure services are stopped when they've completed their work so that the resources can be reclaimed by the system. This is really basic stuff that the most junior Android dev should know. 

Suggested posts