I have an ImageView and I want to to scale CENTER_CROP. If I set the image src and scale type in XML it works great. But I need to set the image in code. The fo
CENTER_CROP
setBackgroundResource sets imageView's background so it is normal behaviour that stretches...
setBackgroundResource
Use setImageResource instead, it will set imageview's source so it will follow your scaleType definition.
setImageResource