WearableListenerService STICKY Vs NOT_STICKY

2019-08-31 14:26发布

问题:

I am trying to find the difference between having the WearableListenerService sticky or not sticky. This is because of the nature of the WearableListenerService that it does not run constantly. So is there any advantages of having it Sticky or not sticky? According to my testing, in both cases the behaviour of the service is the same. Service is created when phone reboots or when app launches. Even when it is not sticky, the wear is capable of connecting at any time, etc. Thanks!

回答1:

In most normal cases, that service is started through binding and not explicitly by calling startService, so sticky or not doesn't make any difference. If there is a particular use case that you have in mind, feel free to share that with us to help you further.