title: Notification resume app instead of restart
body: <p>I've read multiple questions and answers surrounding this issue, however I cannot get any of them to work for me.</p>
  
  <p>I have a notification that on click I would like to bring the application to the front and resume rather than close and restart.</p>
  
  <p>This is my notification code</p>
  
  <pre><code>    NotificationCompat.Builder mBuilder =
              new NotificationCompat.Builder(this)
              .setSmallIcon(R.drawable.ic_launcher)
              .setContentTitle("example")
              .setContentText("example");
      // Creates an explicit intent for an Activity in your app
      Intent resultIntent = new Intent(this, MainActivity.class);
      resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
      // The stack builder object will contain an artificial back stack for the
      // started Activity.
      // This ensures that navigating backward from the Activity leads out of
      // your application to the Home screen.
      TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
      // Adds the back stack for the Intent (but not the Intent itself)
      stackBuilder.addParentStack(MainActivity.class);
      // Adds the Intent that starts the Activity to the top of the stack
      stackBuilder.addNextIntent(resultIntent);
      PendingIntent resultPendingIntent =
              stackBuilder.getPendingIntent(
                  0,
                  PendingIntent.FLAG_UPDATE_CURRENT
              );
      mBuilder.setContentIntent(resultPendingIntent);
      NotificationManager mNotificationManager =
          (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      int mId = 0;
      // mId allows you to update the notification later on.
      mNotificationManager.notify(mId, mBuilder.build());
  </code></pre>
  
  <p>And in my manifest file I have</p>
  
  <pre><code>        android:launchMode="singleTop"
  </code></pre>
  
  <p>Can anyone see what is going wrong? I get no errors, although the notification refuses to resume the app and instead restarts it.</p>