title: How can I know which button was clicked in the notification?
body: <p>I am developing an application, I have 2 buttons in an on the notification. How can I know which button the user has clicked?</p>
  <p>This my Notification codes;</p>
  <pre><code>public void  NotificationSettings(Context context){
          Intent stateIntent = new Intent(context, MyBroadcastReceiver.class);
          stateIntent.putExtra(&quot;id&quot;, 100);
          PendingIntent pendingIntent =
                  PendingIntent.getBroadcast(context, 0, stateIntent, PendingIntent.FLAG_UPDATE_CURRENT);
  
          builder = new NotificationCompat.Builder(context, &quot;access2020&quot;)
                  .setSmallIcon(R.drawable.ic_baseline_add_alert_24)
                  .setContentTitle(&quot;Academy Notification&quot;)
                  .setContentText(&quot;Hey this is an important notifications&quot;)
                  .setPriority(NotificationCompat.PRIORITY_DEFAULT)
                  .addAction(R.drawable.ic_baseline_add_alert_24, &quot;Set Active&quot;, pendingIntent)
                  .addAction(R.drawable.ic_baseline_add_alert_24,&quot;Dismiss&quot;, pendingIntent);
  
          notificationManager = NotificationManagerCompat.from(context);
      }
  </code></pre>
  <p>and My Broadcast</p>
  <pre><code>public void onReceive(Context context, Intent intent) {
          Toast.makeText(context, &quot;test&quot;, Toast.LENGTH_SHORT).show();
          int notificationId = intent.getIntExtra(&quot;id&quot;, 0);
          NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
          notificationManager.cancel(notificationId);
          }
  </code></pre>