A background service in Android stops running when the user exits the app using the BACK button. The same service works fine if the app is in foreground or in background (clicking the HOME button).
- Create an app as explained in this GIST: https://gist.github.com/e309f6a56ea6cb1fd394
- Run the app on Android: as soon as the app starts, a notification is shown every 10 seconds
After that, there are 3 cases:
1. Keep the app running: every 10 seconds a notification is shown (OK).
2. Put the app in background by clicking the HOME button: notifications keep showing (OK)
3. Click the BACK button (this closes the app): the background service is stopped and no more notifications are shown (BUG)
Also in case #3, the notifications should keep running every 10 seconds.