Button or AppCompatButton?

I put Button in activity_quiz.xml and found during debugging that it was actually AppCompatButton instance. What gives?

The AppCompat library helps with bringing modern theming to your app on all Android versions you care about (among other things).

To make this possible, AppCompat does a few interesting things behind the scenes. As you inflate your layout file, the AppCompat library switches some of your components to AppCompat versions (AppCompatButton, AppCompatTextView, etc). So, your AppCompatButton is still a subclass of Button, but it has some theming support built in.

1 Like