Free Android app covering all aspects of addiction, including prevention and treatment

 

Doing it on the quiet: how to use an IntentService

intentService iconYou should do time consuming work, like downloading files, on a separate thread.

This will free up the main thread so your user can carry on using the app.

IntentServices are the preferred way for doing long running background operations.

You can request an IntentService from any of your fragments or activities. The requests are queued and handled one-after-the-other. The IntentService stops once all the requests have been handled.