2018년 1월 12일 금요일

How to control loading screen (white / black) when running Android App

After you develop and run your app in Android Studio, you'll see an initial white or black screen popping up and running your code.

This is what happens after building with Android Studio. I had never seen this phenomenon when I was building it in Eclipse before (maybe I was not interested.

This phenomenon occurs when the number of jobs in OnCreate increases.

To prevent this, you can do the following three methods.

1. Transparent treatment.
  It is a way to make it disappear altogether. However, if you use this method, the app may seem to stop for a while after you press the button.
 Open the res-> values-> styles.xml file and add the following two items to the style item set in AndroidManifest.xml.
<item name = "android: windowContentOverlay"> @ null </ item>
<item name = "android: windowIsTranslucent"> true </ item>

2. Color change processing.
 How to change the color to the color you want.
 Open the res-> values-> styles.xml file and add the following two items to the style item set in AndroidManifest.xml.
<item name = "android: windowBackground"> ​​@ color / red </ item>

3. Image processing.
How to specify an image in the same way as iPhone.
 Open the res-> values-> styles.xml file and add the following two items to the style item set in AndroidManifest.xml.
<item name = "android: windowBackground"> ​​@ drawable / splash </ item>

 Of course, the above image must be registered.

Then ^^;