I've read the official android docs and they say that
A bound service runs only as long as another application component is bound to it.
Thus, I understand that if I have an Activity and call a Service from that Activity, then when an activity is destroyed also the service is destroyed.
This work well when I press the back button and exit the application.
The problem is: when I rotate the screen the onDestroy()
callback from the Activity is called, but the onDestroy()
callback from the Service isn't called...
Taking into account the above citation from the official docs can someone explain me why this happens?
Note that I have only one activity bounded with that service.