title: Android - Clear task flag not working for PendingIntent
body: <p>I have a task stack of A > B > C. I am currently on C, and then I press the home button. I get a notification with the intent to take me to Activity A. I press the notification, and I'm at A but if I press back, I go to C, then B, then A.</p>
  
  <p>I am setting up my PendingIntent like so. Anything clearly wrong with it?</p>
  
  <pre><code>final Intent notificationIntent = new Intent(mContext, ActivityA.class);
          notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
  
  
          PendingIntent contentIntent = PendingIntent.getActivity(myContext, 0, notificationIntent, 0);
  </code></pre>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I tried the suggestion here: <a href="https://stackoverflow.com/questions/5979171/clear-all-activities-in-a-task">Clear all activities in a task?</a></p>
  
  <pre><code>notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
  </code></pre>
  
  <p>but I still get the same result. My activity A starts in my application task stack, I press back and go to C, then B, then A again.</p>
  
  <p>I am starting to think that this is either not possible in Android or it's not possible when using a pending intent.</p>
  
  <p><strong>EDIT 2:</strong>
  This is not a matter of what flags are needed. More of an issue of what could be going wrong that the flags seem to have no effect.</p>