I am doing a demo on FCM where if i click on notification it should go to notification class and show the notification message. But whenever I click notification it always redirect to default launcher activity i.e MainActivity. I have seen so many duplicate question like me but no where proper solution. Whatever solution I have found I have tried those also not working. Please look into my intent code and let me know where I have done mistake or I am missing anything else to add anything in my code.
Intent resultIntent = new Intent(mCtx, NotificationActivity.class);
resultIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(mCtx, 0, resultIntent,
PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_ONE_SHOT);
mBuilder.setContentIntent(pendingIntent);
And in manifest also I have put like
android:exported="true"
but still it redirects to MainActivity every time.