title: How to group pushnotifications in android?
body: <p>I have implemeted push notification in android,and it comes perfectly as per needed,But only one problem is it displaying as individualy ,I want it in grouping,means if 5 notifications are there,it should display "5 messages" not a list of notification(which is currentl[y coming),My code is as belo,I have found solution that <strong>style</strong> can do this,and have tried but no change,</p>
  
  <p><strong>code</strong></p>
  
  <pre><code>@SuppressWarnings("null")
      public void sendNotification(String title, String description) {
          Random random = new Random();
          int id = random.nextInt(50);
          NotificationCompat.Builder myNotification = null;
          NotificationManager notificationManager = null;
  
          notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
  
          Intent myIntent = new Intent(context, ActivityHome.class);
          myIntent.putExtra("push", "push");
          TaskStackBuilder taskbuiler = TaskStackBuilder.create(this);
          taskbuiler.addParentStack(ActivityHome.class);
  
          taskbuiler.addNextIntent(myIntent);
          PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, myIntent, Intent.FLAG_ACTIVITY_NEW_TASK);
  
          Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  
          myNotification = new NotificationCompat.Builder(context);
          NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
          String[] events = new String[6];
          // Sets a title for the Inbox in expanded layout
          inboxStyle.setBigContentTitle("Event tracker details:");
  
          // Moves events into the expanded layout
          for (int i = 0; i &lt; events.length; i++) {
  
              inboxStyle.addLine(events[i]);
          }
          // Moves the expanded layout object into the notification object.
          myNotification.setStyle(inboxStyle);
  
          myNotification.setStyle(new NotificationCompat.InboxStyle());
          myNotification.setContentTitle(title);
          myNotification.setContentText(description);
          myNotification.setContentIntent(pendingIntent);
          myNotification.setDefaults(Notification.DEFAULT_SOUND);
          myNotification.setAutoCancel(true);
          myNotification.setSmallIcon(R.drawable.app_icon);
          myNotification.build();
  
          notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
          notificationManager.notify(id, myNotification.build());
  
      }
  </code></pre>