Action bar color changes after loading

When I first start my app, the action bar is one color, but as the activity ends, it unexpectedly changes hue more easily, although I am not doing anything programmatically to change it.

These are my styles.xml:

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

<style name="MyActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/sp_orange</item>
    <item name="android:titleTextStyle">@style/TitleColor</item>
    <item name="android:displayOptions"></item>
</style>

<style name="TitleColor" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@android:color/white</item>
</style>

      

It starts off as a nice shade of orange (sp_orange as indicated), then lighter.

I tried commenting out the android: background element in case I accidentally set the light color programmatically without realizing it - the result was that the action bar started black and then turned to a dark gray shade.

Does anyone know why this is happening and how to prevent it?

+3


source to share





All Articles