title: cancelAll() and cancel() don't dismiss my notification
body: <p>I am facing this problem for a long time now, I have an application with many functions, one of them is the alarm</p>
  
  <p>My notification just stays there and never disappears <strong>although I am calling <code>cancelAll()</code> / <code>cancel()</code> from the notification manager, also I have <code>autoCancel</code> set to <code>true</code></strong>! It also stays clickable, I just need it to disappear after actions are triggered!</p>
  
  <p><em>(I am testing this on an emulator with Android Studio, not sure if this could be the problem)</em></p>
  
  <p>I searched a lot an tried so many things and nothing worked so I would appreciate the help :)</p>
  
  <p>I have set my notification as follow:</p>
  
  <pre><code>notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
  // ...
  
  private void initNotification() {
      setNotificationChannel();
  
      notificationBuilder = new NotificationCompat.Builder(getApplicationContext(), notificationChannel.getId());
  
      Intent click_intent = new Intent(getApplicationContext(), RingtonePlayingService.class)
              .putExtra("intent_action", "click")
              .putExtra("REQUEST_CODE", alarmRequestCode)
              .putExtra("ID", alarmId);
      PendingIntent click_pending = PendingIntent.getService(this, MainActivity.getRequestCode(), click_intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
      Intent dismiss_intent = new Intent(getApplicationContext(), RingtonePlayingService.class)
              .putExtra("intent_action", "dismiss")
              .putExtra("REQUEST_CODE", alarmRequestCode)
              .putExtra("ID", alarmId);
      PendingIntent dismiss_pending = PendingIntent.getService(getApplicationContext(),MainActivity.getRequestCode(), dismiss_intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
      Intent snooze_intent = new Intent(getApplicationContext(), RingtonePlayingService.class)
              .putExtra("intent_action", "snooze")
              .putExtra("REQUEST_CODE", alarmRequestCode)
              .putExtra("ID", alarmId);
      PendingIntent snooze_pending = PendingIntent.getService(getApplicationContext(),MainActivity.getRequestCode(), snooze_intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
      dismissAction = new NotificationCompat.Action(R.drawable.small_delete,
              "Dismiss", dismiss_pending);
      snoozeAction = new NotificationCompat.Action(R.drawable.bell_ring,
              "Snooze", snooze_pending);
  
      notificationBuilder.setDefaults(Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE)
              .setSmallIcon(R.drawable.alarm)
              .setContentTitle("Alarm On!")
              .setContentText("Click the notification to dismiss")
              .setPriority(NotificationCompat.PRIORITY_DEFAULT)
              .setContentIntent(click_pending)
              .setDeleteIntent(click_pending)
              .addAction(dismissAction)
              .addAction(snoozeAction)
              .setAutoCancel(true);
  }
  
  private void showNotification() {
      notificationManager.notify(alarmRequestCode, notificationBuilder.build());
  }
  
  private void setNotificationChannel() {
      channelId = "alarm_channel_id";
      channelName = "alarm_notification_channel";
      int importance = NotificationManager.IMPORTANCE_DEFAULT;
      notificationChannel = new NotificationChannel(channelId, channelName, importance);
      notificationChannel.enableLights(true);
      notificationChannel.setLightColor(Color.RED);
      notificationManager.createNotificationChannel(notificationChannel);
  }
  </code></pre>
  
  <p>When the actions buttons are pressed this is the part of code triggered:</p>
  
  <pre><code>if (action != null) {
          switch (action) {
              case "click":
                  alarmManager.cancel(cancelPendingIntent);
                  notificationManager.cancelAll();
                  player.stop();
                  changeAlarmValuesToOff();
                  break;
              case "snooze":
                  alarmManager.cancel(cancelPendingIntent);
                  notificationManager.cancelAll();
                  player.stop();
                  setNewSnoozeAlarm();
                  break;
              case "dismiss":
                  alarmManager.cancel(cancelPendingIntent);
                  notificationManager.cancelAll();
                  player.stop();
                  changeAlarmValuesToOff();
                  break;
              default:
          }
      }
  </code></pre>
  
  <p><strong><em>I also tried using <code>cancel()</code> using the <code>alarmRequestCode</code> which is the unique ID used for both alarm and notification and still didn't work</em></strong></p>
  
  <p>Everything is working fine, the actions perform as desired only that the notification stays right there and stays clickable and performing actions as shown in the screenshot below</p>
  
  <p><a href="https://i.stack.imgur.com/gC2T3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gC2T3.png" alt="Screenshot of the notification"></a></p>