SuperMario32 SuperMario32 - 1 month ago 15
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>
</style>


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

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

Answer

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