I am trying to open an Activity when the notification is clicked and below is my code.
Intent intent = new Intent(this.getApplicationContext(),
You have to use FLAG_UPDATE_CURRENT in pendingIntent.
PendingIntent pendingIntent = PendingIntent.getActivity(this, notificationId /* Request code */, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
and also pass the same id to notificationManager
notificationManager.notify(notificationId /* ID of notification */, notificationBuilder.build());