Android

Android getColor() Requires API Level 23

By Lucas
March 5, 2017
1 min min read
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)

 

Related Articles