The main reason for the splash screen is that when we start the activity, we need to run through OnCreate and Onresume to display the interface . This means that some data needs to be processed before it is displayed. According to this idea, is it possible to avoid a black screen if I minimize the initialization work? The fact is, even if you do not do anything oncreate, still will flash a black screen, because it takes a certain time to initialize the parsing interface. Here is the workaround:
I. Custom Theme
//1.Setting the background map theme---The program starts quickly, the interface displays the background map before refreshing the other interface controls. Give people the feeling of refreshing the out of sync<style name="Theme.appstartload"Parent="Android:theme"> <ItemName="Android:windowbackground"> @drawable/ipod_bg</Item> <ItemName="Android:windownotitle">true</Item> </style>///2, Set transparent theme---give the program start slow feeling, the interface one-time brush out, refresh synchronization<style name="Theme.appstartloadtranslucent"Parent="Android:theme"> <ItemName="Android:windowistranslucent">true</Item> <ItemName="Android:windownotitle">true</Item> </style>
Two. Modify Androidmanifest.xml
<ApplicationAndroid:allowbackup="true"Android:icon="@drawable/ipod_icon"Android:label="@string/app_name"Android:launchmode="Singletask"><!--ipod main screen --<activityandroid:name="com.apical.apicalipod.IPodMainActivity" <! -- Use the styles defined above mythou-->Android:theme= "@style/theme.appstartload" android:label= "@string/app_name" ><intent-filter><action android:name="Android.intent.action.MAIN" /><category android:name="Android.intent.category.LAUNCHER" /></intent-filter></activity>//......</applicat
From for notes (Wiz)
Solutions for app development----splash screen