setCompatVectorFromResourcesEnabled

Sets whether vector drawables on older platforms (< API 21) can be used within android.graphics.drawable.DrawableContainer resources.

When enabled, AppCompat can intercept some drawable inflation from the framework, which enables implicit inflation of vector drawables within android.graphics.drawable.DrawableContainer resources. You can then use those drawables in places such as android:src on android.widget.ImageView, or android:drawableLeft on android.widget.TextView. Example usage:

<selector xmlns:android="...">
    <item android:state_checked="true"
          android:drawable="@drawable/vector_checked_icon" />
    <item android:drawable="@drawable/vector_icon" />
</selector>

<TextView
        ...
        android:drawableLeft="@drawable/vector_state_list_icon" />

This feature defaults to disabled, since enabling it can cause issues with memory usage, and problems updating Configuration instances. If you update the configuration manually, then you probably do not want to enable this. You have been warned.

Even with this disabled, you can still use vector resources through setImageResource and its app:srcCompat attribute. They can also be used in anything which AppCompat inflates for you, such as menu resources.

Please note: this only takes effect in Activities created after this call.