Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-05-31 21:45:45 10月05日 Update

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.

Tags: Content system that is time different layout article knowledge article process problem check subject value information reason most screen file method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology NVidia Huawei Xiaomi macOS