Why cant i change UI from other threads as well?
Android was designed around the mobile CPUs of 2005-2007, which were about 2% of the power of today's CPUs. The synchronization overhead of trying to allow multiple threads to manipulate the UI was deemed to be too high. They used a common approach in those cases: designating a special thread to be the one for UI updates, and failing updates that are attempted on other threads.
Some will say its runs services as well
In general, objects do not run on threads -- methods run on threads.
Lifecycle methods on all Android components are called on the main application thread. So, for a Service
, onCreate()
, onStartCommand()
, onBind()
, and onDestroy()
are called on the main application thread.
If that were to happen services will end when application exits
Applications in Android do not "exit".
since main thread gets killed with process
When a process terminates, all components in it also "get killed", and so a service that was in that process will go away.