title: Why do we use the TaskStackBuilder?
body: <p>Why do we use the <code>TaskStackBuilder</code> when creating a notification? I do not get the logic behind it.</p>
  
  <p>Can someone please explain. </p>
  
  <pre><code>public void showText(final String text){
      Intent intent = new Intent (this, MainActivity.class);
      TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
      stackBuilder.addParentStack(MainActivity.class);
      stackBuilder.addNextIntent(intent);
      PendingIntent pendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
      Notification notification = new Notification.Builder(this)
              .setSmallIcon(R.mipmap.ic_launcher)
              .setContentTitle(getString(R.string.app_name))
              .setAutoCancel(true)
              .setPriority(Notification.PRIORITY_MAX)
              .setDefaults(Notification.DEFAULT_VIBRATE)
              .setContentIntent(pendingIntent)
              .setContentText(text)
              .build();
      NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
      notificationManager.notify(NOTIFICACTION_ID, notification);
  }
  </code></pre>