0
votes

Issue

I'm attempting to change the background (colour/drawable) during the 'cold start' phase of my apps' launch.

I have a few test devices and I've created a simple custom theme which overrides the background attribute of the parent theme. When I launch my app, on my Android 10 device the background shows perfectly fine and full-screen (whether a colour or drawable).

On my Android 5.1 (Lollipop) device, I get no such luck and the background is just plain black.

Theme Code This is how I've setup my theme in values/styles.xml...

<style name="MyTheme" parent = 
    "@android:style/Theme.DeviceDefault.Light.NoActionBar.Fullscreen">
    <item name="android:background">@drawable/myDrawable</item>
</style>

Note: 'myDrawable' is defined (it's just a bitmap image). As mentioned, it doesn't apply on Android 5.1 during startup. Same if I just set a hex color value ('#ffffff' for example).

Am I misunderstanding something, or do I need to do something different for older devices?

1

1 Answers

0
votes

You should use
<item name="android:windowBackground">@drawable/myDrawable</item>