title: android restart Activity when leaving and going back to my app
body: <p>I am currently trying to handle the exit and restart of my app.</p>
  
  <p>So when I press the home button my app closes and the android home screen is visible. 
  The app process still remains in the process list - this is how its supposed to be.</p>
  
  <p>When I then go back to my app, I want to start it again just like i started it the first time.
  I have only 1 activity and here is what i do at the moment</p>
  
  <pre><code>@Override
  protected void onPause() {
      // TODO Auto-generated method stub
      super.onPause();
      this.finish();
  }
  </code></pre>
  
  <p>So the activity closes properly - this leaves me with a blank activity when i resume my app.</p>
  
  <p>Unfortunatly I dont know how to change the behaviour that the activity is created again.</p>
  
  <p>Edit</p>
  
  <pre><code>@Override
  protected void onResume() {
      // TODO Auto-generated method stub
      super.onResume();
  
      callResume++;
      if(callResume &gt; 1)
      {
          Intent newInt = new Intent("android.intent.action.MainActivity");
          startActivity(newInt);
          this.finish();
  
      }
  }
  </code></pre>