I noticed that when I download the app from the Activity on which I have 1 button on the Galaxy S5 API 21 then the background of the Activity white, when I upload the same app to HTC Desire 500 API 19 then the background is already black ..

And it turns out that there is a problem with the design ...

How to make the background always the color you need? I thought it should be in styles, but why then for one device one color is chosen for another another ...

The only solution that came to mind is to write on each Activity

 android:background="" 

Who knows this is the only solution or can you specify somewhere in the settings ??

This is how you added the style attribute.

 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <windowBackground>#ffffff</windowBackground> <item name="colorPrimary">#2196F3</item> <item name="colorPrimaryDark">#ffffff</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:icon">@drawable/stardavida</item> </style> </resources> 

    1 answer 1

    Most likely you need a style attribute.

     windowBackground 

    those. in styles.xml in the style of the application we write:

     <item name="android:windowBackground">@android:color/white</item> 
    • I added a style attribute to the question, but it doesn’t work for me ... How to add it? - Aleksey Timoshchenko
    • @AlekseyTimoshchenko, try this: <item name="android:windowBackground">#ffffff</item> - JuriySPb
    • @AlekseyTimoshchenko, please) Answer supplemented. - Yuriy SPb