Android launches black screen white screen solution

Source: Internet
Author: User

In the app's splash page will appear a short black screen or white screen, will bring a very bad user experience, the reason is because the resources have not been loaded to complete the black screen or white screen, and we see the black and white screen is actually the top window, the following summarizes two solutions.

* * Set the window layer interface for our splash interface.

<!--prevent black screen at startup, add window picture--    <style name= "theme.appstartload" parent= "Android:theme" >        <item Name= "Android:windowbackground" > @mipmap/start</item>        <item name= "Android:windownotitle" >  True</item>    </style>

Then use the following in the manifest file:

<activity            android:name= ". Activity. Launcheractivity "            android:screenorientation=" Portrait "            android:theme=" @style/ Theme.appstartload
"> <intent-filter> <action android:name=" Android.intent.action.MAIN "/> <category android:name=" Android.intent.category.LAUNCHER "/> </intent-filter> </activity>

The effect is that you can see the splash interface directly when you start. However, it is not possible to set the immersive status bar, and the second method is recommended for students with obsessive-compulsive disorder.

* * Set Window Transparent

<!--prevent black screen from starting, make window background transparent--    <style name= "theme.appstartloadtranslucent" parent= "Android:theme" >        <item name= "Android:windowistranslucent" >true</item>        <item name= "Android: Windownotitle ">true</item>    </style>

The same in the manifest file configuration:

<activity            android:name= ". Activity. Launcheractivity "            android:screenorientation=" Portrait "            android:theme=" @style/ Theme.appstartloadtranslucent "            >            <intent-filter>                <action android:name=" Android.intent.action.MAIN "/>                <category android:name=" Android.intent.category.LAUNCHER "/>            </intent-filter>        </activity>

If you have a better way to welcome the message.

Android launches black screen white screen solution

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.