Android-Use the theme profile to get rid of the short black screen of the program launch screen

Source: Internet
Author: User

about the black screen

By default, when the program starts, there is a black screen period, because the first activity loads some data, such as initializing the list data.

Removal Steps

1./res/values/styles.xml in Theme, add a Android:windowbackgrounds property to set the desired picture

2. In Androidmanifest.xml, set theme to the first startup activity.

3. Add/res/drawable-port/loading.png (if the splash screen of the horizontal screen, please put in/res/drawable-land/loading.png)

4. Complete

Code
<stylename= "MyTheme.NoTitleBar.CustomBackground"Parent= "@android: Theme.black">          <Itemname= "Android:windowbackground">@drawable/loading</Item>          <Itemname= "Android:windownotitle">True</Item>          <Itemname= "Android:windowfullscreen">True</Item>          <Itemname= "Android:windowcontentoverlay">@null</Item>   </style>
<ApplicationAndroid:icon= "@drawable/icon"Android:label= "@string/app_name"android:debuggable= "true">                    <ActivityAndroid:label= "@string/app_name"Android:theme= "@style/mytheme.notitlebar.custombackground"android:configchanges= "Keyboardhidden|navigation|orientation"Android:name= "Com.test.ui.MainActivity"android:screenorientation= "Portrait">            <Intent-filter>                         <ActionAndroid:name= "Android.intent.action.MAIN">                              <categoryAndroid:name= "Android.intent.category.LAUNCHER">   </category>                      </Action>         </Intent-filter>   </Activity>  ...  ...</Application>
I'm the dividing line of the king of the land Tiger.

Reference: http://blog.csdn.net/kepoon/article/details/6759724

Android-Use the theme profile to get rid of the short black screen of the program launch 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.