BindService will not be destroyed as long as there is another activity bound to this service. It must wait until all activities are called unbound() before it can be destroyed.
Service life cycle diagram
A practical experience is to send a message to the Service before the activity's unBound() to tell the service that the activity is to be unbound. This blog post has some source code and an introduction to Android BoundService inter-process communication
In addition, does Mediaplayer call release() in onDestroy of service?
Only the current playback interface is bound to it, and the mediaplayer is not released in the service. But logically speaking, since my activity has been finished and the bound service has been destroyed, the mediaplayer in the service should also be destroyed.
Did you call unBind before finish?
BindService will not be destroyed as long as there is another activity bound to this service. It must wait until all activities are called
unbound()
before it can be destroyed.Service life cycle diagram
A practical experience is to send a message to the Service before the activity's unBound() to tell the service that the activity is to be unbound. This blog post has some source code and an introduction to Android BoundService inter-process communication
In addition, does Mediaplayer call release() in onDestroy of service?
Only the current playback interface is bound to it, and the mediaplayer is not released in the service. But logically speaking, since my activity has been finished and the bound service has been destroyed, the mediaplayer in the service should also be destroyed.