Declaring a style, when I define an item android:backgroundTint
, I get a warning that this is available as of API 21 onward, while my minimum API specified is lower (API 17). On the other hand, when I replace that with simply backgroundTint
, the warning is gone. Does anyone know why is that?
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:backgroundTint">#0F0</item>
</style>
Aside, from that, if I use android:backgroundTint
for a single component, for example a button, I get no warning or error, no matter what my project's minimum SDK is. This is somewhat puzzling.
backgroundTint
introduced in API21 . Read Here. So this Style belongs to style v-21 . And for warning i think this is happening becausebackgroundTint
individually not an attribute so not getting compiled . – Astrograph