I\'m using a third party library, there is a method using DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
. When I test my app in android 5.0+,ther
If you look at the source code for DrawableCompat you will see that for any version < support library 21
the method does nothing.
The idea of DrawableCompat seems to be simply not crashing on old versions, rather than actually providing that functionality.
With support library 22.1
you can use DrawableCompat to tint drawables.
DrawableCompat.wrap(Drawable) and setTint(), setTintList(), and setTintMode() will just work: no need to create and maintain separate drawables only to support multiple colors!
i used ?colorPrimary for creating button background and its sake error in my project , and i change ?colorPrimary to @color/colorPrimary and its work for me :)