title: android how to reload main activity after exit the apps
body: <p>Halo guys,</p>
  
  <p>My apps is set to be exit after double click the back button,
  but if i open the apps again, it just return to the previous page that i exit.</p>
  
  <p>How can i truly exit the apps after double click back button, while i will return to the previous page if i exit by home screen button?</p>
  
  <p>here is my exit code:</p>
  
  <pre><code>@Override
  public void onBackPressed() {
      if (doubleBackToExitPressedOnce) {
          Intent intent = new Intent(Intent.ACTION_MAIN);
          intent.addCategory(Intent.CATEGORY_HOME);
          intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(intent);
          return;
      }
      this.doubleBackToExitPressedOnce = true;
      Toast.makeText(this, "Please click BACK again to exit",
              Toast.LENGTH_SHORT).show();
      new Handler().postDelayed(new Runnable() {
  
          @Override
          public void run() {
              doubleBackToExitPressedOnce = false;
  
          }
      }, 2000);
  }
  </code></pre>