I tried to make a custom button style for all my buttons in my app like in this question/solution. I want to do it like that because I dont want to add:
android:style="@style/MyButtonStyle"
to every button
My current code.
styles.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:buttonStyle">@style/MyButtonStyle</item>
</style>
<!-- Button style. -->
<style name="MyButtonStyle" parent="android:style/Widget.Button">
<item name="android:textColor">@color/ColorTextIcons</item>
<item name="android:background">@color/ColorAccent</item>
</style>
Manifest
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
In the preview in android studio it looks good, however when I run the app i get a default button style. As far as I know its the same as the accepted answer with 120 upvotes.
What is wrong with the code and why is it showing different in android studio?
Preview in android studio.
My device (s5 mini android 4.4.2)
NOTE I dont apply any different styles/themes to the activitys