title: Notification auto cancel not working for Android lollipop
body: <p>I want to auto cancel my notification when user clicks on notification. The following code works good in all the devices except Android lollipop device. In  Lollipop device, notification goes only when user swipes it off.</p>
  
  <pre><code>@SuppressWarnings("deprecation")
  public void sendNotification(int id){
  
      NotificationCompat.Builder mBuilder =
              new NotificationCompat.Builder(this)
              .setSmallIcon(R.drawable.ic_launcher)
              .setContentTitle("Test")
              .setContentText("Jump to next screen")
              .setDefaults(Notification.DEFAULT_SOUND)
              .setAutoCancel(true);
  
      mBuilder.getNotification().flags |= Notification.FLAG_AUTO_CANCEL | Notification.FLAG_ONLY_ALERT_ONCE;
  
  
      // Creates an explicit intent for an Activity in your app
      Intent resultIntent = new Intent(this, NextActivity.class);
  
     resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
      PendingIntent resultPendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, 
                                      resultIntent, 0);
      //PendingIntent.FLAG_UPDATE_CURRENT
  
      mBuilder.setContentIntent(resultPendingIntent);
      NotificationManager mNotificationManager =
          (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      // id, if there is a need to update the notification later on.
      mNotificationManager.notify(id, mBuilder.build());
  
      Log.v(TAG, "Notification ID value " + id);
  
      //mNotificationManager.cancel(id);
  }
  </code></pre>
  
  <p>What is missing in this code?</p>