Reputation: 43
The application uses bound service. So, the service is NOT started using startService anywhere. Every activity which needs to access the service binds to it using bindService.
In some situations service is going foreground (with startForeground).
In particular there might be a situation when nothing is bound to service (which, according to the doc means that service will be stopped) but it's running in the foreground (which means that it wont' be stopped). Which of those rules have priority? Will system stop unbound service when it's running in foreground?
Thanks.
Upvotes: 1
Views: 1274
Reputation: 1006724
In some situations service is going foreground (with startForeground).
This is not particularly useful, as the process will already be in the foreground, because the activity using the service is in the foreground.
Which of those rules have priority?
The service will be destroyed after the last client has unbound from it. startForeground()
does not impact this.
Upvotes: 1