title: How to dismiss big view notification after clicking one of its buttons (not the content area)
body: <p>I have followed Google's tutorial to create a <a href="http://developer.android.com/training/notify-user/expanded.html" rel="nofollow noreferrer">Big View Styled Notification</a> (here <a href="https://github.com/android/platform_development/tree/master/samples/training/notify-user/src/com/example/android/pingme" rel="nofollow noreferrer">their source code</a>):</p>
  
  <p><img src="https://i.stack.imgur.com/Yoi1U.png" alt="screenshot"></p>
  
  <p>in <a href="https://github.com/afarber/android-newbie/tree/q13/MyNotification/src/de/afarber/mynotification" rel="nofollow noreferrer">my own simple test app</a> which displays toasts after clicking on one of the buttons (either in the app or in the big notification):</p>
  
  <p><img src="https://i.stack.imgur.com/4CPhp.png" alt="screenshot"></p>
  
  <p>It works well except for one small problem:</p>
  
  <p>When clicking one of the buttons ("OPEN" or "FLASH") in the notification - I can not see the toast, because it is covered by the black notifications pane.</p>
  
  <p>So my question is: <strong>How to cancel the big notification and close the notifications pane, after I have clicked one of its buttons?</strong> (i.e. not the notification content, but the choice buttons).</p>
  
  <p>Here is my notification building code in <a href="https://github.com/afarber/android-newbie/blob/q13/MyNotification/src/de/afarber/mynotification/MainActivity.java" rel="nofollow noreferrer">MainActivity.java</a> - there is an <code>setAutoCancel(true)</code> call there, but it only works for the content area:</p>
  
  <pre><code>Intent openIntent = new Intent(this, RegionService.class);
  openIntent.setAction("open");
  PendingIntent piOpen = PendingIntent.getService(this, 0, openIntent, 0);
  
  Intent flashIntent = new Intent(this, RegionService.class);
  flashIntent.setAction("flash");
  PendingIntent piFlash = PendingIntent.getService(this, 0, flashIntent, 0);
  
  mNotificationBuilder = new NotificationCompat.Builder(mContext)
      .setSmallIcon(R.drawable.ic_launcher)
      .setContentTitle(question)
      .setContentText(question)
      .setTicker(question)
      .setContentIntent(contentIntent)
      .setAutoCancel(true)
      .setDefaults(Notification.DEFAULT_ALL) 
      .setStyle(new NotificationCompat.BigTextStyle()
           .bigText(question))
      .addAction(R.drawable.open,
          getString(R.string.open_car_short), 
          piOpen)
      .addAction(R.drawable.flash,
          getString(R.string.flash_lights_short), 
          piFlash);
  </code></pre>
  
  <p>Also, I wonder why are the strings "OPEN" and "FLASH" capitalized?</p>
  
  <p><strong>UPDATE:</strong> I have tried <a href="https://github.com/afarber/android-newbie/blob/q14/MyNotification/src/de/afarber/mynotification/RegionService.java" rel="nofollow noreferrer">cancel(NOTIFICATION_ID)</a> as suggested by Marcin (thanks) and it dismisses the notification, but doesn't close the notification pane. So I still can not see the toasts</p>