title: How to preserve current back stack (or task) when notification is clicked?
body: <p>In my application, I create a notification which starts <strong>Details Activity</strong>. I want to add this activity to top of <strong>current</strong> task (or back stack). For example I expect application task (back stack) to behave like this:</p>
  
  <p><a href="https://i.stack.imgur.com/YWUze.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YWUze.png" alt="enter image description here"></a></p>
  
  <p>but I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/fuJ67.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fuJ67.png" alt="enter image description here"></a></p>
  
  <p>I have not used <code>FLAG_ACTIVITY_CLEAR_TASK</code> and <code>FLAG_ACTIVITY_NEW_TASK</code> flags. What should I do?</p>
  
  <p>Edit: First picture is just an example. I think the the question's title is completely explicit. I want to add <strong>Details Activity</strong> on top of current stack, and not to start with a new task.</p>
  
  <p>This is how I create the <code>PendingIntent</code>:</p>
  
  <pre><code>    // Details activity intent
      Intent intent = new Intent(context, DetailsActivity.class);
      intent.putExtra(Com.KEY_ID, event.getId());
      PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
              intent, PendingIntent.FLAG_UPDATE_CURRENT);
  </code></pre>
  
  <p>And this is the manifest:</p>
  
  <pre><code>    &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name_system"
          android:launchMode="singleTop"
          android:theme="@style/AppTheme.NoActionBar"&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name=".NoteActivity"
          android:label="@string/app_name_system"
          android:theme="@style/AppTheme.NoActionBar"
          android:windowSoftInputMode="stateHidden" /&gt;
  
      &lt;activity
          android:name=".DetailsActivity"
          android:launchMode="singleTop"
          android:label="@string/app_name_system"
          android:theme="@style/AppTheme.NoActionBar" /&gt;
  </code></pre>