I am trying to get all of my activities to have a custom theme style that should look like this:
This theme works on many devices, including the Nexus 7, the Samsung Galaxy S4, and the Samsung Droid Charge (running Gingerbread). However, on other devices, such as HP Slate 7 and Motorola Droid RAZR, it ends up looking like this:
I have the following in my AndroidManifest.xml
's application
tag:
android:theme="@style/AppTheme"
The theme is as follows in res/values/styles.xml
:
<style name="AppBaseTheme" parent="@android:style/Theme.Light.NoTitleBar">
</style>
<style name="AppTheme" parent="@style/AppBaseTheme">
<item name="android:windowBackground">@color/background</item>
</style>
I have also added a styles.xml
under res/values-v11
. Here is the applicable style from there:
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
</style>
Finally, this appears in styles.xml
under res/values-v14
:
<style name="AppBaseTheme" parent="@android:style/Theme.DeviceDefault.Light">
</style>
I have tried to define the theme for each activity and to manually use the setTheme()
function in onCreate()
, but nothing has worked. I have also tried to manually set a background in every Activity
, and this did not work either. What can I do to fix my problem?
EDIT: What's interesting is setting android:background
in the styles makes it work, but then elements that should not have backgrounds receive that background color as well.