title: Android - use of FLAG_ACTIVITY_NEW_TASK
body: <p>I have created a simple application having a button. Clicking it triggers a notification, and clicking on the notification launches a new instance of the same application. However, I wanted that clicking on the notification should bring me back to the application instance from which the notification was triggered. For this I consulted the Android docs for the <code>FLAG_ACTIVITY_NEW_TASK</code> flag-</p>
  
  <blockquote>
    <p>When using this flag, if a task is already running for the activity you are now starting, then a new activity will not be started; instead, the current task will simply be brought to the front of the screen with the state it was last in. See FLAG_ACTIVITY_MULTIPLE_TASK for a flag to disable this behavior. </p>
  </blockquote>
  
  <p>Based on this when creating the intent for passing to the PendingIntent, i set this flag. However, clicking on the notification still launches a new instance of the application.</p>
  
  <p>What am I doing wrong ?</p>