The IntentService class provides a straightforward structure for running an operation on a single background thread.
The IntentService class provides a straightforward structure for running an operation on a single background thread. This allows it to handle long-running operations without affecting your user interface's responsiveness. Also, an IntentService isn't affected by most user interface lifecycle events, so it continues to run in circumstances that would shut down an AsyncTask
An IntentService has a few limitations:
- It can't interact directly with your user interface. To put its results in the UI, you have to send them to an Activity.
- Work requests run sequentially. If an operation is running in an IntentService, and you send it another request, the request waits until the first operation is finished.
- An operation running on an IntentService can't be interrupted.
However, in most cases an IntentService is the preferred way to simple background operations.