I can specify an activity to launch in an app with the the following inside AndroidManifest.xml
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
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.
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.
How can I programmatically decide which activity to launch based on some persisted state?