Search code examples
androidbackground-processintentserviceandroid-intentservice

Is IntentService queue is maintained when service is killed (closed)?


Currently, I developing SNS application that can post comments on a article. and I want to process some network processes in background (e.g. Service, etc.). But I have some worry about that. Is it safe when user killing the application If I implement that features through IntentService?

I have planned all of 'Comment Request' stores into IntentService queue. but It takes a risk when user kill the application. (I guess Android OS have to destroys IntentService Queue)

So, I want to question about that. IntentService's intent queue is maintaining when user close (kill) the application? If not, how I handle this problem? using database or something to save IntentService queue? Absolutly, I have no idea with this.


Solution

  • If the user kills the application, services are safe. If they wish to go into their phones application manager and stop the service, that's entirely different, something that can't be stopped, so that's when the service would end. Your intent service will be fine. For more information: [https://developer.android.com/training/run-background-service/create-service.html]