Reputation: 5177
From the AsyncTask documentation i have read that once an Application is taken into the background, it is liable to be cancelled. Does the same hold for an IntentService. Once an application is in the background, will be cancelled by the OS, or are we guaranteed that this will run to completion.
Kind Regards
Upvotes: 0
Views: 257
Reputation: 1006614
Once an application is in the background, will be cancelled by the OS, or are we guaranteed that this will run to completion.
Nothing is guaranteed. The user might terminate your process via a task killer. The battery might run dead. The user might power off the device. The device might be run over by a large truck.
It is more likely that an IntentService
will last to completion than will merely an AsyncTask
, insofar as the existence of a service in the process makes it less likely that the OS will decide to terminate your process to free up memory for other processes.
Upvotes: 3