Meaning / Use of "android: colorBackground"

Can someone explain what the use of the android attribute android: colorBackground also means? And how is it used by Android itself? I read the doc , but that does not make it more clear:

Color that matches (as closely as possible) the window background. 
+4
source share
3 answers

I'm just getting started with Android Studio, but this is what I found out about using colorBackground. In your res / values ​​/styles.xml you will use it this way

 <resources> <color name="colour_name">#bada55</color> <color name="white">#ffffff</color> <style name="AppThemeA" parent="android:Theme.AppCompat.Light"> <!-- Customize your theme here. --> <item name="android:colorBackground">@color/colour_name</item> <item name="android:textColor">@color/white</item> </style> </resources> 

Hope this answers your question.

+1
source

I think that the android will use this color as a β€œfake” background if the proper background resource is not yet ready for rendering (for example, loading an image in an asynchronous process) or in cases where a fake solid background color may be enough (preliminary thumb viewing, etc.).

Unfortunately, I don’t know exactly where / how / when it is used.

0
source

This is used in Android N and higher as the background color for the copy / paste popup when long press EditText

0
source

Source: https://habr.com/ru/post/1500024/


All Articles