foreground-service
Sticky foreground service fails to restart with a “process is bad” error
For your vanilla version of your service, consider followings: 1- uninstall your app 2- reboot your device 3- reinstall your vanilla service version to just logging. It should work. For your foreground service consider using stopSelf or stopService methods and not stopForegroundService method. stopForegroundService just stop the service from being a foreground. It does not … Read more
What is the difference between a background and foreground service?
Perhaps this will answer your question: A started service can use the startForeground API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. By default services are background, meaning that if … Read more
What is the proper way to stop a service running as foreground
From your activity, call startService(intent) and pass it some data representing a key to stop the service. From your service, call stopForeground(true) and then stopSelf() right after it.