I am trying to change the background color of the ActionBar
of my app.
I tried the following changes,
In style.xml file, I added "MyTheme" and "ActionBarBackground" like below.
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.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">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="AppBaseTheme">
<item name="android:actionBarStyle">@style/ActionBarBackground</item>
</style>
<style name="ActionBarBackground" parent="AppBaseTheme">
<item name="android:background">#00008b</item>
</style>
</resources>
And then,
Manifest file, I added for that particular activity
like below,
<activity android:name="LoginActivity" android:theme="@style/ActionBarBackground">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What happens is, It changes to blue color for the background of entire activity view rather than to change color just to the action bar.
Could someone advise, what i’m doing wrong here.