Services do not work in Ui / main thread.
The service can also start (in the background), even when the application is closed, so you can receive a push notification, listen to the intent that was triggered when you receive a push, and use it to wake up your application.
source share