In my audio recording application, I created a job service which will schedule a job of recording at scheduled frequency intervals. Once I schedule the job to record for every 5 minitues(example), after few recordings, when I force stop the application, I could see job service is still running and tries to record and fails. All other services in the application are stopped.
When I force stop the application why job service is still running? Do I need to take any extra care to stop the job service?
So you can prevent it by destroying the service when the user closes the app, through the following two ways.
First, from within the Service class, call:
OR
Second, from within another class, like your MainActivity for example:
Both of these will stop your service. Make sure you are returning START_NOT_STICKY so that the service doesn't start back up again.