Today’s #AndroidDev #Protip from +Nick Butcher and +Katherine Kuan is on a smoother app launch experience.
On app launch, Android displays a simple preview window (based on your activity theme) as an immediate response to the user action. Then the preview window crossfades with your actual UI, once that has fully loaded. To ensure a smooth visual transition, your activity theme should match your full UI as closely as possible. The below image shows how the experience can be jarring if not handled properly.
For example, if your activity does not require an action bar, then disable it in your theme so that it doesn’t briefly appear in the preview window. To do this, use or extend an activity theme with no action bar. You can also override the background color of the window, if applicable, to better match your full UI.
<style name="AppBaseTheme" parent="android:Theme.Holo.NoActionBar">
When using an action bar in your activity you can tweak it’s displayOptions such as showing or hiding the title or logo to achieve a smooth app launch. For more info on this refer to the documentation http://goo.gl/G8lJgj
& Action Bar API guide http://goo.gl/sSbXNf
Don’t be tempted to use this functionality to build a splash screen as the preview window is shown whenever the activity is constructed i.e. after configuration changes such as rotating your device; not just on the first app launch. Do use this to create a smooth experience for your users, minimising jarring transitions. For more info on gorgeous app launching see this blog post http://goo.gl/PR4hCr
by +Cyril Mottier.