Service terminates after exiting the application

I am working on a music player application and working as a remote service. When I click the back button to exit, the service stops. Why is this happening?

It also shows the following logcat message

android.app.ServiceConnectionLeaked
+3
source share
1 answer

You need to return START_STICKYfrom the service onStartCommand. Check the official documentation

+5
source

Source: https://habr.com/ru/post/1778980/


All Articles