I created an app that upon pressing a start button the app then creates a notification letting the user know the app is running. I noticed however that if the user were to kill the application by swiping it away in the task bar then the notification is not closed. Is there a way to cancel the notification if the app is closed altogether? I still want the user to have the ability to leave my app such as go to home the screen and leave it running in the background, I just want cancel the notification only if the app have been totally closed. Can I somehow check if the app closed from the service running my notification and if so then cancel it?