In code examples where service is declared with intent filters in manifest I do not see explicit start of the service. It looks like using intent filters is similar to subscription to system events, so I assume service is created by the system itself. However, it’s not clear for me whether service is even started in that case.
Asked
Active
Viewed 31 times
0
-
you have to call `Context#startService` no matter if it has intent filters or not – pskink Apr 03 '18 at 08:59
-
@pskink But I have service which extends from Firebase messaging service, and nowhere I start it explicitly. – Pavel Voronin Apr 03 '18 at 09:01
-
maybe not directly, but for sure firebase code you are using in your app does call it – pskink Apr 03 '18 at 09:02
-
@pskink Ok then, I need to understand that subtlety. The presence of main activity in manifest causes start of the service, but nothing happens, if activity is not defined ... – Pavel Voronin Apr 03 '18 at 09:06
-
i have no idea what you mean honestly.... – pskink Apr 03 '18 at 09:06
-
@pskink Look at this [question](https://stackoverflow.com/questions/49574844/will-service-be-called-if-application-has-no-activity). – Pavel Voronin Apr 03 '18 at 09:11