Group Notifications on Android

advertisements

I want to show notifications like on picture. If there is more than one, I want to show a counter too. I didn't find info in official doc. Now I just update my notification by id:

((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE))
                .notify(PUSH_NOTIFICATION_ID, notification);

How can I do it ?


NotificationCompat.Builder mBuilder = new  NotificationCompat.Builder(getApplicationContext());
            mBuilder.setSmallIcon(R.mipmap.ic_launcher);
            mBuilder.setContentTitle(topic);
            mBuilder.setContentText(new String(message.getPayload()));
            mBuilder.setAutoCancel(true);
            mBuilder.mNumber = 1;//get your number of notification from where you have save notification

            NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
            mNotifyMgr.notify(notify_id, mBuilder.build());