title: Clear notification on Action Button click
body: <p>I am trying to clear an notification when an user clicken on the action button. I searched a lot on stackoverflow and google, tried a lot but all failed. So I was wondering, if there is any solution how to fix it?</p>
  
  <p>My code for creating notification:</p>
  
  <pre><code>final int NOTIFICATION_ID = 1;
  NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
  builder.setSmallIcon(R.drawable.ic_info_black_24dp);
  builder.setStyle(new NotificationCompat.BigTextStyle().bigText("Geschiedenis \nFrans \nDuits \nNatuurkunde \nWiskunde"));
  builder.setContentTitle("Rooster: ");
  builder.setOngoing(true);
  builder.setAutoCancel(true);
  builder.setDefaults(Notification.DEFAULT_ALL);
  builder.setAutoCancel(true);
  Intent showIntent = new Intent(this, MainActivity.class);
  PendingIntent contentIntent = PendingIntent.getActivity(this, 0, showIntent, 0);
  builder.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Sluiten",  contentIntent);
  builder.setContentIntent(contentIntent);
  NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  notificationManager.notify(NOTIFICATION_ID, builder.build());
  </code></pre>
  
  <p>So to be clear: I would like to clear (close) the notification once "Sluiten" is clicked.</p>