Right now I have some class myService extends Service (), which is called using the startService function from a different context. The service runs some code in onStartCommand, and then is destroyed / killed.
What is a foreground service and how is it created? Does it last longer than other services?
If so, that would be ideal, because I was busy with a music player in my service, which I would like to play in the background and control. Now the problem is that my service is created and destroyed several times, so I launch too many instances of the music player and lose control of the original.
Thank.
source
share