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?
Asked
Active
Viewed 623 times
0

LEE
- 3,335
- 8
- 40
- 70
-
1Possible duplicate of [How to set VectorDrawable as an image for ImageView programmatically](https://stackoverflow.com/questions/41098015/how-to-set-vectordrawable-as-an-image-for-imageview-programmatically) – nomag Oct 11 '17 at 14:15
1 Answers
1
To get the srcCompat effect programmatically on your imageview use the setImageResource method

Natan Felipe
- 173
- 1
- 5