title: Jelly bean notification actions disabled
body: <p>I'm building an app that shows a notification with two options "Dim" and "Full" when a BroadcastReceiver is called. Each of this buttons broadcasts an action.</p>
  
  <p>So far everything is possible to do, right?</p>
  
  <p>The problem is that the buttons shown on the notification do not respond to the tap but the whole notification does (if I click on the icon or text instead of the button).</p>
  
  <p>I have this function to build the notification:</p>
  
  <pre><code>private Notification buildReleaseNotification(NotificationManager nManager, Context context) {
  
      Notification.Builder builder = new Builder(context);
      builder.addAction(R.drawable.rate_star_big_half_holo_dark, "Dim", buildPendingIntent(context, DIM));
      builder.addAction(R.drawable.rate_star_big_on_holo_dark, "Full", buildPendingIntent(context, FULL));
  
      builder.setContentTitle("Car notification");
      builder.setContentText("Freed");
      builder.setSmallIcon(R.drawable.ic_launcher);
      builder.setOngoing(true);
  
      Notification notification = builder.build();
      return notification;
  }
  </code></pre>
  
  <p>and it is called when receiving a broadcast:</p>
  
  <pre><code>    public void onReceive(Context context, Intent intent) {
  
      NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
  
      Notification noty = null;
      noty = buildReleaseNotification(context);
      startService(context, RELEASE);
  
      if (noty != null) {
          nManager.notify(ChangeLockService.GLOBAL_TAG, ID, noty);
      }
  
  }
  </code></pre>
  
  <p>------ edit</p>
  
  <p>Just noticed that the following function returns null... So, how can I build a pending intent to perform a broadcast?</p>
  
  <pre><code>private PendingIntent buildPendingIntent(Context context, String action) {
  
          Intent i = new Intent(action);
          PendingIntent pi = PendingIntent.getBroadcast(context, ID, i, Intent.FLAG_RECEIVER_REPLACE_PENDING);
          return pi;
      }
  </code></pre>