title: Cannot start activity from Push notification
body: <p>I want to start activities when users click on push notifications. It works fine for activity A, but does not work for another activity B, it does not fully work. What happened to activity B is that if the app is not running, clicking on the push notification will correctly start activity B. However, if the app is already running, clicking on the push notification just open the current screen.</p>
  
  <p>Here is how I set up the push notification:</p>
  
  <pre><code>Intent rewardsIntent = new Intent(this, ActivityRewards.class);
  rewardsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  NotificationUtils.createNotification(this, R.string.reward_notification, getResources().getString(R.string.reward_notification), "You have been rewarded", rewardsIntent);
  </code></pre>
  
  <p>And the static method in NotificationUtils to create the Push Notification:</p>
  
  <pre><code>public static void createNotification(Context context, int notificationId, String title, String text, Intent resultIntent) {
      NotificationCompat.Builder mBuilder =
              new NotificationCompat.Builder(context)
              .setSmallIcon(R.drawable.ico_launcher)
              .setContentTitle(title)
              .setContentText(text);
  
      PendingIntent resultPendingIntent =
              PendingIntent.getActivity(
              context,
              0,
              resultIntent,
              PendingIntent.FLAG_UPDATE_CURRENT
          );
  
      mBuilder.setContentIntent(resultPendingIntent);
      mBuilder.setAutoCancel(true);
      mBuilder.setOngoing(true);
  
      NotificationManager mNotificationManager =
          (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
      mNotificationManager.notify(notificationId, mBuilder.build());
  }
  </code></pre>
  
  <p>In AndroidManifest.xml, I declared the activity as follows:</p>
  
  <pre><code>   &lt;activity android:name=".ActivityRewards"
                android:label="@string/my_rewards"
                android:exported="true"&gt;
     &lt;/activity&gt;
  </code></pre>
  
  <p>This has puzzled me for few days. Any help would be very much appreciated. Thanks.</p>