Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to add a background color to all my app activities by declaring a theme but when I add a hex color code in the xaml declaration I get an error on the hex code.The code is as follows:

Create a themes.xml file in res/values:

XML
<resources>
 <style name="MyTheme" parent="@android:style/Theme.Light"> 
  <item name="android:windowBackground">#FF0000</item>
 </style>
</resources>

... and then in your AndroidManifest.xml specify this as the theme for your activities to use.

XML
<activity
        android:name=".MyActivity"
        android:theme="@style/MyTheme" />
Posted

1 solution

What is the error you are getting on the hex code? Please check this [LINK] to understand how you can achieve it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900