title: How to re-open (or resume) previously launched activity from a url link (deep link)?
body: <p>I'm using deep linking to open my app this is the intent filter:</p>
  
  <pre><code>        &lt;intent-filter&gt;
              &lt;data android:scheme="http" /&gt;
              &lt;data android:scheme="https" /&gt;
              &lt;data android:host="myapp.delivery" /&gt;
              &lt;data android:pathPattern="/.*" /&gt;
  
              &lt;action android:name="android.intent.action.VIEW" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p><strong>Our use case is:</strong> </p>
  
  <ol>
  <li>user open apps, browses some restaurant</li>
  <li>user clicks restaurant (openning MenuActivity an activity with the restaurants menu)</li>
  <li>user click on a menu category for example Pizzas or Desserts or Soups, which opens the CategoryActivity.</li>
  <li>user clicks on a Dish to add to shopping cart I need to send an email with a url to the user.</li>
  </ol>
  
  <h1>My problem:</h1>
  
  <p>(Following step 4) User clicks url on email app (say gmail or inbox app) which prompts user with dialog to open my app or browser like this:</p>
  
  <p><a href="https://i.stack.imgur.com/oeLXw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oeLXw.png" alt="enter image description here"></a></p>
  
  <p>When user clicks to open with my app what happens is that the GotEmailActivity is opened on top of gmail app, I need it to open on top of previously opened instance of my app.</p>
  
  <p>As you can see here 2 instances of my app are open (the first instance of app and the second instance is open on top of gmail),:</p>
  
  <p><a href="https://i.stack.imgur.com/2lpJC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2lpJC.png" alt="enter image description here"></a></p>
  
  <h1>How to open clicked link in my previously launched app not on top of gmail/inbox app?</h1>