I created background servicea tab androidusing the method startService()inside Activity. Then I create the Threadon method onStart(). I read from the Android developer site that the service does not depend on activity, but when I destroy the Activityandroid system , it also kills service. I want the service to continue until I stop it myself.
I know this can be done with help AlarmManger, but it consumes battery. There is no need for a push notification, but the service should be running in the background. Any suggestions on how to solve this?
source
share