android - Set vector drawable programmatically pre lolipop -


very common problem twist couldn't find solution for. setting vector programmatically. want able change tint color programmatically too. found solutions such programmatically tint support vector

imageview iv = .... drawable d = vectordrawablecompat.create(getresources(), r.drawable.ic_exit_to_app_24dp, null); d = drawablecompat.wrap(d); drawablecompat.settint(d, headertitlecolor); iv.setimagedrawable(d); 

the main problem comes

iv.setimagedrawable(d); 

i found prelolipop accepts setting view's drawable with

iv.setimageresource(int resource) 

i couldn't find solutions setting drawable file.

any suggestions?

use appcompatimageview has setimagedrawable() method.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -