Книга: Beginning Android
A common pattern, particularly when using
AlarmManager for scheduling periodic background work, is to have a service that implements
onStart() and forks a background thread to do the desired work. This runs the risk of forking too many threads, though, and managing your own work queue and thread pool can be annoying.
IntentService class wraps that pattern up for you. All you do is implement
onHandleIntent(), and Android will process all inbound Intents via a work queue on a background thread. Android will also automatically stop the service when the work queue becomes empty, to help minimize the memory footprint of your application.