I want to use a background drawable for all my activities. How can I do this with a style?
// styles.xml
<style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar.ForceOverflow">
<item name="android:background">@drawable/my_background</item>
</style>
that sets the background for all widgets it seems. I just want it to work for activities.
Thanks
Apply a style as a theme You can create a theme the same way you create styles. The difference is how you apply it: instead of applying a style with the style attribute on a view, you apply a theme with the android:theme attribute on either the <application> tag or an <activity> tag in the AndroidManifest. xml file.
Defining Styles This XML file resides under res/values/ directory of your project and will have <resources> as the root node which is mandatory for the style file.
Use
<item name="android:windowBackground">@drawable/my_background</item>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With