Master da Web
Back to Blog

Android getColor() Requires API Level 23

LucasMarch 5, 20171 min readUpdated on November 4, 2023
Android getColor() Requires API Level 23

When using a newer API (API level 23) with support for older API’s (API Level 15), we have a small problem when trying to change the background programmatically.

“Call requires API level 23 (current min is 15)…”

To solve this problem, Android offers ContextCompat:

ContextCompat.getColor(context, R.color.suspendedAccount)

 

Share

Need Hosting or Servers?

Discover our VPS, dedicated servers and professional hosting solutions

Related Articles

View all articles