title: Notification stays after my app is killed
body: <p>i have a static media player in a AsyncTask
  when <code>onPause()</code> is called i create a notification</p>
  
  <pre><code>if(Reproduce.mPlayer!=null &amp;&amp; Reproduce.mPlayer.isPlaying()  ){
  nPanel = new Controler(getApplicationContext());
  }
  </code></pre>
  
  <p>when <code>onResume()</code> is called, the notifications dissapear.</p>
  
  <pre><code>if(nPanel != null) {
          nPanel.notificationCancel();
      }
  </code></pre>
  
  <p>so far so good!</p>
  
  <p>but if i kill my app by swiping the notification stays, i dont want this and i not find a way to avoid this.</p>
  
  <p>Pd: if i kill app from app>force kill -the notification disappear</p>
  
  <blockquote>
    <p>this is my notification code</p>
  </blockquote>
  
  <pre><code>public class Controler {
  
  private Context parent;
  private NotificationManager nManager;
  private NotificationCompat.Builder nBuilder;
  private RemoteViews remoteView;
  
  public Controler(Context parent) {
      // TODO Auto-generated constructor stub
      this.parent = parent;
      nBuilder = new NotificationCompat.Builder(parent)
              .setContentTitle("Parking Meter")
              .setSmallIcon(R.drawable.stock)
              .setOngoing(true);
  
      remoteView = new RemoteViews(parent.getPackageName(), R.layout.notificationview);
  
      //set the button listeners
      setListeners(remoteView);
      nBuilder.setContent(remoteView);
  
      nManager = (NotificationManager) parent.getSystemService(Context.NOTIFICATION_SERVICE);
      nManager.notify(2, nBuilder.build());
  
    }
  
  public void setListeners(RemoteViews view){
      //listener 1
  
      Intent volume = new Intent(parent,NotificationReturnSlot.class);
      volume.putExtra("DO", "volume");
      PendingIntent btn1 = PendingIntent.getActivity(parent, 0, volume, 0);
      view.setOnClickPendingIntent(R.id.btn1, btn1);
  
      //listener 2
      Intent stop = new Intent(parent, NotificationReturnSlot.class);
      stop.putExtra("DO", "stop");
      PendingIntent btn2 = PendingIntent.getActivity(parent, 1, stop, 0);
      view.setOnClickPendingIntent(R.id.btn2, btn2);
  
    }
  
  public void notificationCancel() {
      nManager.cancel(2);
     }
    }
  
      @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
  
  
      String action = (String) getIntent().getExtras().get("DO");
      NotificationManager nMgr = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
      nMgr.cancel(2);
      try{if (action.equals("volume")) {
          if(Reproduce.mPlayer != null) {
              if (Reproduce.mPlayer.isPlaying()) {
                  Reproduce.mPlayer.stop();
  
  
                  finish();
              }
          }
  
          //Your code
      } else if (action.equals("stop")) {
          //Your code
          Log.i("help", "stopNotification");
          try {
              Intent intent = new Intent(getApplicationContext(), MainActivity.class);
              intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // You need this if starting
              //  the activity from a service
              intent.setAction(Intent.ACTION_MAIN);
              intent.addCategory(Intent.CATEGORY_LAUNCHER);
              startActivity(intent);
          }catch (Exception e ){}
      }
      finish();
  }catch (Exception e){}
  
   }
  </code></pre>
  
  <blockquote>
    <p>and AndroidManifest.xml</p>
  </blockquote>
  
  <pre><code>        &lt;activity android:name=".NotificationReturnSlot"
          android:launchMode="singleTask"
          android:taskAffinity=""
          android:excludeFromRecents="true"/&gt;
  </code></pre>
  
  <p><code>onPause()</code> will not work because it will kill notification everytime is called and <code>onDestroyd()</code> is never called </p>