Perfect solution startup, switch between activity, black screen problem

Source: Internet
Author: User

By default, when the activity starts to brush the screen into white or black, and then draw the interface, draw the interface more or less a little delay, this time you see is white screen, obviously affect the user experience, how to eliminate it?

Set style in Activity theme

<style name= "Apptheme" parent= "Android:Theme.Light.NoTitleBar" >        <item name= "Android: Windowistranslucent ">true</item>        <item name=" Android:windownotitle ">true</item>        <item name= "Android:windowactionbar" >false</item>        <item name= "Android:windowbackground" >@  Android:color/transparent</item>        <!--All customizations that is not specific to a particular api-level can Go here. -    </style>
it means to keep the window in a transparent state .

Since OnCreate () sometimes loads too much data, causing the interface to be too late to display, after changing the theme, the program background will be transparent, showing the interface of the previous program until the loading is complete


Note: Set a background for your layout layouts, or you can see the desktop when you are finished loading!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Perfect solution startup, switch between activity, black screen problem

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.