title: Prevent Activity from closing when original Activity is finished
body: <p>I'm writing an application that fetches information from the web before it can function correctly. I therefore wrote an InitialActivity that shows a loading screen at startup.
  A button on this initial screen allows to go to an InfoActivity while you're waiting. If the loading is finished while the InfoActivity is running, this InfoActivity stops and the MainActivity that succeeds the InitialActivity starts.</p>
  
  <p>The InitialActivity contains the method that starts the InfoActivity. Loading from the webpage is performed using an inner-class defined AsyncTask. If loading is successful, the onPostExecute() method starts the mainactivity.</p>
  
  <pre><code>public class InitialActivity extends Activity{  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_initial);
  
          new RequestTask().execute(getString(R.string.website));
      }
  
      public void startInfoActivity(View v){
          Intent i = new Intent(this, InfoActivity.class);
          startActivity(i);
      }
  
      private class RequestTask extends AsyncTask&lt;String, Void, Boolean&gt;{
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
      @Override
      protected Boolean doInBackground(String... uri){
          //DO THE INFORMATION FETCHIN
      }
  
      @Override
      protected void onPostExecute(Boolean passed) {
          super.onPostExecute(passed);
  
          if(passed){
              //SAVE THE FETCHED INFORMATION
  
  
              //close this activity and lauch main activity
              Intent i = new Intent(InitialActivity.this, MainActivity.class);
              startActivity(i);
  
              // close this activity
              finish();
      }
  }
  </code></pre>
  
  <p>Is there a way to block the automatic shutdown of the InfoActivity when the loading in the AsyncTask is finished? When the user then selects to leave the InfoActivity, the MainActivity should show up.</p>
  
  <p>Thanks in advance.</p>