I want to send a extra to an activity when user clicks on a notification. Extras is received correctly, but the activity is reset when user clicks on the notification. I want to keep current activity without relaunching it when it is already opened.
This is how I create the notification:
Intent notifIntent = MyActivity.getIntent();
notifIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NotificationCompat.Builder(context)
.setContentIntent(PendingIntent.getActivity(context, notificationId, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT))
But MyActivity is always relaunched, despite it already running in foreground.