title: Prevent Android from recreating already existent activity
body: <p>My problem is with deeplinking to my app. To be more specific, this also only happens when trying to open a deeplink to my app from Facebook Messenger with chat heads active.</p>
  
  <p>Sometimes, when trying to return(not open, just return after messenger has overlayed app) to my app(which has only one activity) using a deeplink from FBMessenger the activity gets recreated. <code>onCreate</code> method is called and a new instance of my activity is being created. The main problem is that this does not happen after the old activity is destroyed, I've added logs and first new activity's <code>onCreate</code> gets called, and only after that old activity's <code>onDestroy</code> gets called.</p>
  
  <p>So why does Android try to create a new instance of my activity if it hasn't destroyed the old one yet?</p>
  
  <p>Activity's <code>launchMode</code> is set to <code>singleTask</code>.</p>
  
  <p>Edit: Also tried with <code>launchMode</code> set to <code>singleInstance</code> or <code>singleTop</code>.</p>
  
  <p>Edit 2: Found possible fix by adding <code>android:documentLaunchMode="intoExisting"</code> to activity. Will do a few more tests tomorrow morning and post this fix as solution if everything works fine.</p>