IntentService
is not what you want to use if the queue of work needs to be persistent. If you send many Intent
s to an IntentService
and then the process is killed by Android, there is no way to rebuild the queue. IntentService
simply queues the Intent
s up using an internal Handler
and these are not persisted anywhere. They just get lost.
If I were you I would just implement this myself. The code for IntentService
isn't that large and you can look at it and use it as a model for your own Service
. You'll want to write your queue to a database so that it is persistent. Return START_STICKY
from onStartCommand()
so that Android will automatically restart your Service
if it is killed due to resource requirements.