I am doing some investigation on Google Play Location Service Google Play Location Samples
I am experiment the following issue on LocationUpdatesForegroundService sample application: the app process is still running after closing the app.
Steps to reproduce it:
- Open app
- Press "request location updates" button
- Press device home button for sending application in background
- Close the app
My expectation is that the app process (and all its threads) has to be stopped but it does not.
The app process is still running after closing the app
It happens when I close the app after calling
startForeground(NOTIFICATION_ID, getNotification());
How can avoid it?
It looks related with the foreground service for collecting location. How can I stop the service while the app is closing?