I can't get Bandle from Notification
public class NotificationsService extends FirebaseMessagingService { Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Intent intent = new Intent(this, MainActivity.class); intent.putExtra("notification", notificationModel); intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOPIntent.FLAG_ACTIVITY_CLEAR_TOP); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setContentTitle(map.get("alert")) .setContentText(map.get("alert")) .setSmallIcon(R.drawable.com_facebook_button_icon) .setAutoCancel(false) .setContentIntent(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)) .setSound(sound); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = notificationBuilder.build(); notification.flags = Notification.FLAG_AUTO_CANCEL; notificationManager.notify(0,notification); } And the MainActivity to which we are moving on PendingIntent
@Override protected void onResume() { super.onResume(); Intent intent = getIntent(); notificationModel = (NotificationModel) intent.getSerializableExtra("notification"); if (notificationModel != null){ App.showLog(notificationModel.toString()); } } And in notificationModel comes null