I have created one android app in which I am starting a service by calling startService() method. I want to stop the service when the task assigned to it is completed. How can I check that the corresponding task is completed? Can I call stopSelf() in onStartCommand()? What is the best practice to call stopSelf() or stopService() method? Where should the call of it be placed?
Thanks!
I have created one android app in which I am starting a service by
Share
1 Answer