title: PendingIntent launches different activity of the app package
body: <p>I'm developing notifications in my app, and I'm having some issue with the pending intent that is driving me crazy.</p>
  
  <p><strong>Normal flow</strong>: My app has the launcher activity (Activity A, singleTop) which shows a Splash and then launches Activity B (singleTop too).</p>
  
  <p><strong>Notification:</strong>
  When app is in background, I show a notification on the notification bar, which opens the launcher activity of my app when clicked, through a PendingIntent. This PendingIntent addresses to Activity A (singleTop). But in this scenario, instead of open Activity A, it brings to foreground the Activity B, but without calling onNewIntent() (onResume() is being called instead), so I can't retrieve the extras of the notification Intent and show the information, because this Activity B.getIntent() retrieves the old intent which opened the activity the first time.</p>
  
  <p>Can any of you bring me some light on this issue, please?</p>
  
  <p>This is how I set up the PendingIntent:</p>
  
  <pre><code>Intent notificationIntent = new Intent(context, SplashActivity.class);
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_TYPE, "Notification");
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_MESSAGE, "Message");
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_TITLE, "title");
  
  PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
  notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
  </code></pre>
  
  <p><strong>Edited:</strong>
  Following the answer given by @Woodi_333, the code for creating the pending intent is as follow.</p>
  
  <pre><code>Intent notificationIntent = new Intent(context, SplashActivity.class);
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_TYPE, "Notification");
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_MESSAGE, "Message");
  notificationIntent.putExtra(StaticResources.EXTRA_NOTIFICATION_TITLE, "title");
  
  PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
  notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
  </code></pre>