NullPointerException
NullPointerException

Reputation: 37577

Button colorButtonNormal style not working in pre-Lollipop devices

I'm using this trick to change the background color of all the application buttons:

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="colorButtonNormal">@color/unpressed2</item>
</style>

It's working perfectly in post-Lollipop (api 21) devices but in pre-Lollipop it's being ignored.

How can I change the background color of the buttons also in pre-Lollipop devices?

Upvotes: 0

Views: 66

Answers (1)

Rahul Khurana
Rahul Khurana

Reputation: 8835

If you want your Button to work with colorButtonNormal your activity needs to extend AppCompatActivity

Upvotes: 1

Related Questions