Building responsive apps with IntentService
IntentService class is a specialized subclass of
Service that implements a background work queue using a single
HandlerThread. When work is submitted to an
IntentService, it is queued for processing by a
HandlerThread, and processed in order of submission.
If the user exits the app before the queued work is completely processed, the IntentService will continue working in the background. When the IntentService has no more work in its queue, it will stop itself to avoid consuming unnecessary resources.
The system may still kill a background app with an active IntentService, if it really needs to (to reclaim enough memory to run the current foreground process), but it will kill lower priority processes ...