Service stops after I exit my application

android, service

Solution

You need to return `START_STICKY` from the service's `onStartCommand`. Check the official documentation

Problem

I am working on a music player app and it runs as a remote service. When I press back button to exit, the service stops. Why is this happening? It also shows the following logcat message ``` android.app.ServiceConnectionLeaked ```

Original source