title: How to programmatically choose an activity to launch in Android App?
body: <p>I can specify an activity to launch in an app with the the following inside AndroidManifest.xml</p>
  
  <pre><code>        &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p>In my app, a few Activities A,B,C... are needed to initialize it. They will only be shown during the initial installation but not afterwards. </p>
  
  <p>Right now, I use Activity X as default one and call startActivity() within X. However, Activity X is not fully initialized while A,B,C are being displayed and pressing back key can show X in its not fully initialized state which is ugly. </p>
  
  <p>How can I programmatically decide which activity to launch based on some persisted state?</p>