title: Android FLAG_ACTIVITY_NEW_TASK does not resume activity, does not call onNewIntent
body: <p>Neither</p>
  
  <pre><code>val intent = Intent(sourceActivity, SomeActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
  startActivity(intent)
  </code></pre>
  
  <p>nor</p>
  
  <pre><code>val intent = Intent(sourceActivity, SomeActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
  startActivity(intent)
  </code></pre>
  
  <p>triggers <code>onNewIntent</code> as described by <a href="https://developer.android.com/guide/components/activities/tasks-and-back-stack#IntentFlagsForTasks" rel="nofollow noreferrer">official docs</a>:</p>
  
  <blockquote>
    <p>FLAG_ACTIVITY_NEW_TASK Start the activity in a new task. If a task is
    already running for the activity you are now starting, that task is
    brought to the foreground with its last state restored and the
    activity receives the new intent in onNewIntent(). This produces the
    same behavior as the "singleTask" launchMode value, discussed in the previous section.</p>
  </blockquote>
  
  <p>They always try to recreate SomeActivity, calling <code>onCreate</code> instead!</p>
  
  <p><strong>Expected behaviours</strong>:</p>
  
  <ul>
  <li>SomeActivity, running but not on foreground, paused, is brought back to foreground</li>
  <li>SomeActivity's back stack is preserved</li>
  <li>SomeActivity receives some info - I want to inform SomeActivity of a success/ failure</li>
  <li>SomeActivity instance is reused vs. a duplicated is created anew - so <code>FLAG_ACTIVITY_SINGLE_TOP</code> or <code>android:launchMode="singleTop"</code> is not derisable</li>
  </ul>
  
  <p>Interestingly, the Manifest.xml approach works as expected!</p>
  
  <pre><code>&lt;activity
                  android:name=".webview.SomeActivity"
                  android:launchMode="singleTask"
                  android:configChanges="screenSize|orientation" /&gt;
  </code></pre>
  
  <p>What am I missing?</p>