Книга: Beginning Android

IntentService

IntentService

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.

The 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.

Оглавление книги

Оглавление статьи/книги

Генерация: 1.511. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз