In a project with API 16 compatibility I've been using vector drawables with ContextCompat.getDrawable()
which is of course incorrect and crashes in old devices, needing to be replaced by AppCompatResources instead. I have removed all method calls, but how can I prevent them from appearing again in case of distraction?
Note that the API is not deprecated, can a good API be somehow flagged as error in a project? The minSdkVersion
is set to 16 and targetSdkVersion
and compileSdkVersion
to 27, the ContextCompat.getDrawable
API is for all purposes available on any API level, but fails when used with vector drawables, so I want to prevent during compilation its usage in favor of AppCompatResources
.