Skip to content Skip to sidebar Skip to footer

Why Is It Important To Use Services For Background Tasks?

I know I should use Services in Android to do stuff in the background from a non-UI thread. However, I would like to know what is wrong with just spawning a background thread to do

Solution 1:

Actually, Services are used for long running tasks, especially those, that run when your activity is not running. Threads can be used for making some tasks inside your activity. This states, that a Thread, created inside your Activity, can not live outside of the activity that's created it, when a Service can. Hope this helps.


Post a Comment for "Why Is It Important To Use Services For Background Tasks?"