From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Support styles on older devices

Support styles on older devices - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Support styles on older devices

- [Instructor] When creating styles for your app, it's important to make sure you're using attributes that are supported on all the versions of Android where you want your app to run. In a previous exercise, I used an attribute called background tint. And I used it to set the colors of buttons in my application. Now that's actually going to create a bit of an issue. Because if I run this same app on an older version of Android, as I'm doing here, the background may not show up. This is a virtual device on the emulator, that's running Android 4.4 kitkat. And the problem is the background tint attribute was introduced in the API 21. That's Android 5. There was actually a visual hint of this when I was coding. Notice that there's a warning indicator on this attribute declaration. And if I move the cursor over it, it tells me that background tint requires that newer API level. Now I could downgrade my application and not support those older versions of Android, that's just a matter of…

Contents