title: How to get the multiple notification as the group like whatsapp using FCM in android
body: <p><br>
  i have tried below lines of code to get the multiple notification lilke whatsapp but did not get solution please check my code and let me know where am i doing wrong?<br>
  I am using the fcm to achieve this, please help me to short out from this problem</p>
  
  <pre><code>Intent intent = new Intent(this, MainActivity.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
                  PendingIntent.FLAG_ONE_SHOT);
  
          Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  
          NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                  .setSmallIcon(R.mipmap.ic_launcher)
                  .setContentTitle("Firebase Push Notification")
                  .setContentText(messageBody)
                  .setAutoCancel(true)
                  .setSound(defaultSoundUri)
                  .setContentIntent(pendingIntent)
                  .setNumber(4);
  
  
              numMessages=numMessages+1;
  
              for (int i = 0; i &lt;= numMessages; i++) {
                  notificationBuilder.setContentText(messageBody)
                          .setNumber(numMessages);
                  NotificationManager notificationManager =
                          (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
                  notificationManager.notify(0, notificationBuilder.build());
  
              }
  </code></pre>
  
  <p>Please check the below image, in which i have showed that which type of group message i want to implement using <code>FCM</code><br>
  <a href="https://i.stack.imgur.com/MZ5lA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MZ5lA.png" alt="enter image description here"></a></p>