My application has a splash screen as its Launcher activity, and I have an option in the Shared Preferences to go straight to the Main Activity, so I needed a way to programmatically select the Launcher activity.
I initially tried using another activity that launches before the splash screen, and performs the logic that opens the next activity, as suggested here Programmatically change launcher activity but I found that the screen flickered during activity transitions even with android:noHistory="true" declared in the manifest.
Instead I added the same simple logic used in the activity mentioned above to my original splash screen activity, which sets the screen content based on the shared preferences. I use a handler and a postDelayed timer which dictates how long the splash screen is displayed and as an experiment I set the postDelayed time quite low, 100 ms, and there is no obvious screen flickering during the transition to the Main Activity. Why is this so?