Android Question Application background color

obscure

Member
Licensed User
Longtime User
Hey all.

I'm a bit picky! If I set an application to use Theme.Holo.Light and launch it
there'll be a white background until the 'real' content of the application is
visible.
If I set the theme to Theme.Holo it will be black.
Is there a way to set this to a custom color?

Thanks!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this to the manifest editor:
B4X:
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
<color name="backgroundColor">#FFC441C4</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
 <style
   name="LightTheme" parent="@android:style/Theme.Material.Light">
     <item name="android:background">@color/backgroundColor</item>
   <item name="android:windowBackground">@color/backgroundColor</item>
   <item name="android:colorBackground">@color/backgroundColor</item>
 </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
 <style
 name="LightTheme" parent="@android:style/Theme.Holo.Light">
   <item name="android:background">@color/backgroundColor</item>
   <item name="android:windowBackground">@color/backgroundColor</item>
   <item name="android:colorBackground">@color/backgroundColor</item>
 </style>
</resources>
)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…