If I understand the API docs on IntentService correctly, intents sent to an IntentService queue up if it is processing and are processed sequentially.
Is there an easy way to tell IntentService that it should just drop any intents sent to it while it is processing?
Cheers,
Torsten
No, not an easy way that I know of but perhaps not too difficult.
I think I’ve seen a similar question to this and one suggestion was to simply define your own IntentService class by copying the code from the Android source (there’s less than 150 lines of code and some of that is comments).
The ‘queue’ of Intents is managed by a nested class called ServiceHandler which extends Handler. If you define your own ‘IntentService’ from the source you could add methods to clear the message queue and even terminate the Handler if it is in the middle of processing an Intent (if that’s what you need).