Solutions for app development----splash screen

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.