title: Android Notification Action Button Click Listener
body: <p>I am developing an event planning application, and I'm currently working on a feature for assigning an item to a guest.
  When the item is assigned, a notification is pushed to the guest, asking him whether or not he can bring the required item. Depending on the input of the user, an HTTP request is sent back to the server, updating the status of item (bringing/not bringing).</p>
  
  <p>I'm kind of stuck on responding to the click on the notification action buttons, since I didn't quite understand how it works. I managed to show the action buttons, but couldn't figure out how to respond to clicking on them. As I've seen online, the response to the notification action buttons, is managed by the PendingIntent, which I couldn't manage to understand how it works, and how I can use it to send HTTP requests according to the button clicked.</p>
  
  <p>I'd be glad for some help and advice.</p>
  
  <p>[This is an example of the notification sent to the user.][</p>
  
  <p>This is the method that notifies the user:</p>
  
  <pre><code>    private void notifyUser(Bundle data) {
      ...
      //Notification configuration.
      NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
              .setSmallIcon(...)
              .setLargeIcon(...)
              .setContentTitle(...)
              .setContentText(...)
              .setAutoCancel(...)
              .setSound(...);
  
          //Get the item data from the request sent to the GCM server.
          Item item = GsonFactory.getGson()
                  .fromJson(data.getString("data"), Item.class);
  
          //This is the part that I do not understand...
          notificationBuilder
                  .addAction(R.drawable.ic_close_black, "No", null)
                  .addAction(R.drawable.ic_done_black, "Yes", null);
  
      NotificationManager notificationManager =
              (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
      notificationManager.notify(0, notificationBuilder.build());
  }
  </code></pre>
  
  <p>Thank you in advanced!</p>