title: Android - going back to previous app gives strange message
body: <p>I am using this code to go back to the previous activity in Android:</p>
  
  <pre><code>@ReactMethod
    public void  goBack()
    {
      Intent startMain = new Intent(Intent.ACTION_MAIN);
      startMain.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      MainApplication.getContext().startActivity(startMain);
    }
  </code></pre>
  
  <p>The problem is when I open a link (deep link) from Gmail for example, my app opens on top of the Gmail app and when I'm pressing the back button it shows me the following message:
  <a href="https://i.stack.imgur.com/qVZeA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qVZeA.jpg" alt="enter image description here"></a></p>
  
  <p>What I want is to go back to the previous app or to the Home screen without finishing or killing my app.</p>
  
  <p>I want it to be as if I pressed the multi-apps button and chosen the previous app without closing my app. When I'm using the back button as it is it finishes my app.
  I tried playing with the flags but without success.</p>
  
  <p>There is a Cordova solution for this : <a href="https://github.com/mohamed-salah/phonegap-backbutton-plugin/blob/master/src/android/BackbuttonPlugin.java" rel="nofollow noreferrer">https://github.com/mohamed-salah/phonegap-backbutton-plugin/blob/master/src/android/BackbuttonPlugin.java</a>. Mine is a React Native project.</p>
  
  <p>Any help will be much appreciated!</p>