LEE
LEE

Reputation: 3605

setBackgroundResource programmatically for vector drawables

I have an Imageview in which I have to set a background image from my adapter. Using app:srcCompat in the xml code makes the image appear as it should. However, what should I do if I have to do the same thing programmatically?

Upvotes: 0

Views: 644

Answers (1)

Natan Felipe
Natan Felipe

Reputation: 173

To get the srcCompat effect programmatically on your imageview use the setImageResource method

Upvotes: 1

Related Questions