Android boot white screen or black screen flash solution

Source: Internet
Author: User

1. Set style

///1, set the background map theme

1 <style name= "theme.appstartload" parent= "Android:theme" >  2   <item name= " Android:windowbackground "> @drawable/ipod_bg</item>  3   <item name=" Android: Windownotitle ">true</item>  4 </style>

2. Set Transparent theme

1 <style name= "theme.appstartloadtranslucent" parent= "Android:theme" >  2   <item Name= "Android:windowistranslucent" >true3   <item name= "Android:windownotitle" >  True</item>  4 </style>

I've defined two types of theme, the first of which is to set a background map. When the program starts, this background image is displayed first to prevent a black screen from appearing. The second kind of theme is to set the style to transparent, the program will not be black screen after startup, but the whole transparent, wait until the interface is initialized to show it once. Here are the pros and cons of two ways:

    • The THEME1 program starts quickly, the interface displays the background map first, and then refreshes the other interface controls. Give people a refreshing feeling of being out of sync.
    • Theme2 give the program start slow feeling, the interface once brush out, refresh synchronization.

2, modify the Androidmanifest.xml

To make the above theme effective, we need to set up some activity theme

1<Application2Android:allowbackup= "true"3android:icon= "@drawable/ipod_icon"4Android:label= "@string/app_name"5Android:launchmode= "Singletask" >6 7<!--ipod main screen--8<Activity9Android:name= "Com.apical.apicalipod.IPodMainActivity"Ten<!--use the styles defined above mythou--> OneAndroid:theme= "@style/theme.appstartload" AAndroid:label= "@string/app_name" > -<intent-filter> -<action android:name= "Android.intent.action.MAIN"/> the<category android:name= "Android.intent.category.LAUNCHER"/> -</intent-filter> -</activity> -  + //...... -  +</application>

Android boot white screen or black screen flash solution

Related Article

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.