Difference between android:windowBackground and android:colorBackground?

JabKnowsNothing picture JabKnowsNothing · Oct 8, 2014 · Viewed 31.3k times · Source

What is the difference between android:windowBackground and android:colorBackground?

Example:

<style name = "theme">
 <item name ="android:windowBackground">@color/black</item>
 <item name ="android:colorBackground">@color/black</item>
</style>

Which one would affect the color you see when a new activity is loading?

Answer

abedfar picture abedfar · Jan 14, 2015

windowBackground only affects the main window's background.

colorBackground affects not only the background of the main window but also of all components e.g. dialogs unless you override it in the component layout.

So both of them change the activity's background, but the colorBackground changes many more things as well.