Android Instance-fix startup black screen issue (xe8+ Xiaomi 2)

Source: Internet
Author: User

Results:

1. The image interface appears immediately at startup, but there will be a black screen in the presence of the program, about 0.2 seconds or so.

Realize:

1. Build 2 files: Loading.png and Styles.xml:

① where Loading.png is the image that replaces the black screen at startup.

②styles.xml is the definition of a background image, and its contents are:

1 <Resources>2 3      <!--4 Base application theme, dependent on API level. This theme is replaced5 by Appbasetheme from Res/values-vxx/styles.xml on newer devices.6       -7  <stylename= "MyTheme.NoTitleBar.CustomBackground"Parent= "@android: Theme.black">  8 <item name= "Android:windowbackground" > @drawable/loading</item>9 <item name= "Android:windownotitle" >true</item>Ten <item name= "Android:windowfullscreen" >true</item> One <item name= "Android:windowcontentoverlay" > @null </item> A   </style>  -       -      <stylename= "Appbasetheme"Parent= "Android:Theme.Light"> the <!-- - Theme customizations available in newer API levels can go - Res/values-vxx/styles.xml, while customizations related to - backward-compatibility can go here. +  - -      </style> +  A      <!--application theme. - at      <stylename= "Apptheme"Parent= "Appbasetheme"> - <!--all customizations, that is, specific to a particular api-level can go. -      </style> -  -  </Resources>

2. Because the case is sensitive in Java, the file name "Loading" in the Styles.xml definition must be lowercase.

3. Files Styles.xml and loading.png are best placed in the root directory of the project file. Anyway, do not put in the root directory outside, its subfolders can be, folders in English, just build justice, do not want to trouble the best in English.

4. Package the established 2 files in the installation file:

①project->deployment->add files-> Select File Styles.xml and Loading.png.

The ②platform property is set to Android.

③remotepath Properties:

The RemotePath of Styles.xml is res\values\

The RemotePath of Loading.png is res\drawable-port\

5. Project default configuration file AndroidManifest.template.xml:

①CTRL+F9 compile the project file and generate the relevant configuration file, open the directory where the project file is located, you can find it.

② Notepad Open the AndroidManifest.template.xml file and look for the following text:

Android:theme= "%theme%"

Replace with the following text, note that it is replaced, not new, and then close and save.

Android:theme= "@style/mytheme.notitlebar.custombackground".

6. Recompile.

Android Instance-fix startup black screen issue (xe8+ Xiaomi 2)

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.