title: Android Wear: How to setup notifications with page and action that are stacked and the action is working?
body: <p>The app creates several notifications with a page and an action. These notifications are stacked/grouped. </p>
  
  <p>However, the associated actions are not working, an error is shown on the smartwatch when clicking on the blue round action button. It is working without the grouping or without the page. It is also working for actions on the group summary notification. It should work on the single notifications. What needs to be changed?</p>
  
  <pre><code>  public static ArrayList&lt;Notification&gt; buildDemoNotifications(Context context) {
  
      ArrayList&lt;Notification&gt; notifications = new ArrayList&lt;Notification&gt;();
      notifications.add(buildNotification(context, R.string.notification_one_title, R.string.notification_one_content));
      notifications.add(buildNotification(context, R.string.notification_two_title, R.string.notification_two_content));
  
      notifications.add(buildSummaryNotification(context));
  
      return notifications;
  }
  
  private static Notification buildSummaryNotification(Context context) {
      PendingIntent contentIntent = createAppPendingIntent(context);
  
      return new NotificationCompat.Builder(context)
              .setGroup(GROUP_KEY)
              .setGroupSummary(true)
              .setSmallIcon(R.drawable.ic_launcher)
              // this is working
              .addAction(R.drawable.ic_launcher, context.getString(R.string.notification_action), contentIntent)
              .build();
  }
  
  private static Notification buildNotification(Context context, int title, int text) {
      PendingIntent contentIntent = createAppPendingIntent(context);
  
      NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
              .setContentTitle(context.getResources().getString(title))
              .setContentText(context.getResources().getString(text))
              // this is not working
              .addAction(R.drawable.ic_launcher, context.getString(R.string.notification_action), contentIntent)
              .setGroup(GROUP_KEY);
  
      NotificationCompat.WearableExtender extender = buildExtenderWithPage(context);
  
      return extender
              .extend(notificationBuilder)
              .build();
  }
  
  private static NotificationCompat.WearableExtender buildExtenderWithPage(Context context) {
      Notification pageNotification =
              new NotificationCompat.Builder(context)
                      .setSmallIcon(R.drawable.ic_launcher)
                      .setContentTitle(context.getResources().getString(R.string.notification_page_title))
                      .setContentText(context.getResources().getString(R.string.notification_page_content))
                      .build();
  
      return new NotificationCompat.WearableExtender()
              .addPage(pageNotification);
  }
  </code></pre>
  
  <p>There is a demo app for testing at <a href="https://github.com/novoda/Spikes/tree/WearNotifications/WearNotifications" rel="nofollow noreferrer">https://github.com/novoda/Spikes/tree/WearNotifications/WearNotifications</a></p>
  
  <p>This is the logcat on verbose level of the watch. No exception:</p>
  
  <pre><code>09-17 22:19:20.029     462-3277/? I/ActivityManager﹕ START u0 {flg=0x10000000 cmp=com.google.android.wearable.app/com.google.android.clockwork.home.RemoteActionConfirmationActivity (has extras)} from pid 638 on display 0
  09-17 22:19:20.119      462-462/? V/ActivityManager﹕ Display changed displayId=0
  09-17 22:19:20.219      462-486/? I/ActivityManager﹕ Displayed com.google.android.wearable.app/com.google.android.clockwork.home.RemoteActionConfirmationActivity: +104ms
  09-17 22:19:22.029      462-480/? W/ActivityManager﹕ Launch timeout has expired, giving up wake lock!
  09-17 22:19:23.189      820-855/? W/bt-btif﹕ dm_pm_timer expires
  09-17 22:19:23.189      820-855/? W/bt-btif﹕ dm_pm_timer expires 0
  09-17 22:19:23.189      820-855/? W/bt-btif﹕ proc dm_pm_timer expires
  09-17 22:19:24.649      462-486/? E/WindowManager﹕ removeAppFromTaskLocked: token=AppWindowToken{ae795e48 token=Token{ae182d90 ActivityRecord{ae2d3b30 u0 com.google.android.wearable.app/com.google.android.clockwork.home.RemoteActionConfirmationActivity t1 f}}} not found.
  09-17 22:19:24.659      165-165/? W/SurfaceFlinger﹕ couldn't log to binary event log: overflow.
  09-17 22:19:27.089      820-855/? W/bt-btif﹕ dm_pm_timer expires
  09-17 22:19:27.089      820-855/? W/bt-btif﹕ dm_pm_timer expires 0
  09-17 22:19:27.089      820-855/? W/bt-btif﹕ proc dm_pm_timer expires
  </code></pre>
  
  <p>The watch just shows an error message "An error occured"</p>
  
  <p><img src="https://i.stack.imgur.com/aR4Qz.png" alt="an error message"></p>