Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of black and white screen when Android starts APP

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "how to solve the black screen and white screen when Android starts APP", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this article, "how to solve the black screen and white screen when Android starts APP".

In development, when we start app, the screen will appear white or black for a period of time, and the length of time varies with different devices. It affects the user experience very much.

First of all, to analyze the reason for this phenomenon, when we start an application, the system will check to see if such a process already exists, and if not, it is a cold start. Both the system and APP itself have a lot of work to deal with. First, the service of the system will check the information of the intent in the startActivity, then create the process, and finally perform the operation of starting the Acitivy. The problem of displaying white and black screens that we mentioned above was generated during this period of time.

Before drawing the page to load the layout, the system will first initialize the window (Window), and in this step, the system will specify its Theme theme color according to the Theme we set, the top level of the Window layout when DecorView,StartingWindow displays an empty DecorView, our settings in Style determine whether the display is white or black.

The simplest solution

Since the black and white screen is determined according to the Theme we set, we can solve this problem directly from the Theme of the startup page.

Step 1: define the following in the style file

True @ null @ drawable/splash_pic true

Step 2: set the startup page Theme in AndroidManifest

The above is about the content of this article on "how to solve the black and white screen when Android starts APP". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report