title: Cancel notification after application is closed from background
body: <p>I have an activity that shows a notification on notification bar. If the user goes to the background pressing the home button I keep the notification (that's what I need), but when the user closes the application I need to cancel the notification and that's my problem.</p>
  
  <ul>
  <li>I tried to cancel notification on onDestroy but it´s not fired.</li>
  <li>I tried to set setOngoing true for the notification.</li>
  </ul>
  
  <p>How could I deal with this? Every time the user goes background and then close the app I need to remove the notification from the notification bar, but if the user keep the application in background I need the notification.</p>