Hi there,

Suppose you have a download service that downloads files
asynchronously. For each download intent received it will put the URL
of the file to download and the start ID into a job queue and return
START_REDELIVER_INTENT. A worker thread then processes that list and
calls stopSelf with the start ID it just processed.

My question is: If the service's process gets killed and the service
restarted, will the service receive all the intents (with the URLs) it
hasn't called stopSelf on before it was killed or does the service
receive the last intent only? It seems the API docs are ambiguous on
this.

The docs say

"if this service's process is killed while it is started [...], then
it will be scheduled for a restart and the last delivered Intent re-
delivered to it again [...]",

indicating that only the last intent gets redelivered (which would be
terrible in this use case), but they also say

"The service will [...] be re-started if it is not finished processing
all Intents sent to it (and any such pending events will be delivered
at the point of restart)."

Which is it now?

Thanks,
-Jonas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to