Android vectorDrawables.useSupportLibrary = true is stopping app

You cannot use Vector Drawables in any other views except ImageView in pre-lollipop.

Please see this SO Answer by google developer advocate.

For AppCompat users, we’ve decided to remove the functionality which let you use vector drawables from resources on pre-Lollipop devices due to issues found in the implementation in version 23.2.0/23.2.1 [ https://code.google.com/p/android/issues/detail?id=205236, https://code.google.com/p/android/issues/detail?id=204708 ]. Using app:srcCompat and setImageResource() continues to work.

If you want to use the Vector Drawables pre-lollipop, use can set it programatically by converting it into a drawable.

Drawable drawable;

if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
     drawable = context.getResources().getDrawable(drawableResId, context.getTheme());
} else {
     drawable = VectorDrawableCompat.create(context.getResources(), drawableResId, context.getTheme());
}

button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)