SuperMario32 SuperMario32 - 5 days ago 4x
Android Question

Editing activity theme

I'm trying to edit theme like this:

<style name="MyAppTheme" parent="@android:style/Theme.DeviceDefault.Light.DarkActionBar">
<item name="android:background">@color/colorPrimary</item>

But this colours my whole activity. Instead I want only action bar to be coloured with my custom color. How to achieve this?

I've managed to achieve desired result by using Theme Editor and creating custom theme with it.


Try this

<item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>

and please read this for more info