title: How to start native activity while the current activity is still initiating
body: <p>I need an advice on how to start native activity while the current activity is still initiating.. I read the <a href="http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle" rel="nofollow">reference</a> and I don't see what would be the right way to get what I need.</p>
  
  <p>So to explain...</p>
  
  <p>I need to start the native video activity and play some video depending on some conditions.
  So instead of the following:</p>
  
  <pre>
  1. User launch an app (main activity is started)
  2. Welcome screen is displayed while the app is loading
  3. App is ready & running
  </pre>
  
  <p>I need something like this:</p>
  
  <pre>
  1. User launch an app
  1.1. Check If some video is available
  1.2. Play the video 
  1.3. Once the video is finished or user press the back key, continue to step 2.
  2. Welcome screen is displayed while the app is loading
  3. App is ready & running
  </pre>
  
  <p>My current attempt is based on the fact than an activity is paused as soon as some new activity is started so I'm simply starting my video activity in onResume call of the main activity:</p>
  
  <pre><code>public void onResume()
  {
      super.onResume();
      if (someCondition &amp;&amp; !videoIsPlayed)
      {
          videoIsPlayed = true;
          Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
          final Uri data = Uri.parse(videoURL);
          intent.setDataAndType(data, "video/mp4");
          startActivity(intent);
      }
  }
  </code></pre>
  
  <p>However, I didn't found any evidence that above code is actually safe...</p>
  
  <p>Other idea that I have is to introduce  two activities that would be something like an activity chooser where in onCreate I would chose which activity to start:</p>
  
  <pre><code>// Chooses which activity to start
  public class ActivityChooser extends Activity
  {
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
  
          if (someCondition)
          {
              // start main application activity
          } else 
          {
              // start activity that plays the video using the native video activity
          }
          finish();
      }
  }
  </code></pre>
  
  <p>And another activity that starts the native video activity</p>
  
  <pre><code>// Starts the native video activity and once it finishes starts the main app activity
  public class VideoPlayback extends Activity
  {
      public void onResume()
      {
          super.onResume();
          if (someCondition &amp;&amp; !videoIsPlayed)
          {
              videoIsPlayed = true;
              Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
              final Uri data = Uri.parse(videoURL);
              intent.setDataAndType(data, "video/mp4");
              startActivity(intent);
  
              // Question that remains here is how to know when the native video activity is done with
              // the playback in order to start main application activity
          }
      }
  }
  </code></pre>
  
  <p>EDIT: Since there aren't much answers, can one please comment my first approach.</p>
  
  <p>So any suggestions are more than welcome!</p>
  
  <p>Thanks is advance!</p>