What is the difference between ImageView.setBackgroundResource and ImageView.setImageResource?
I have seen these different approaches in setting images but I don't get the difference. Why there two methods? Dimitris Makris setBackgroundResource is for setting the background of an ImageView. setImageResource is for setting the src image of the ImageView. Given: ImageView iv = new ImageView(this); Then: iv.setBackgroundResource(R.drawable.imagedata); Will fit the image for the entire background. That means it will stretch the image to fill that background entirely even if the image size is too small. imageView.setImageResource(R.drawable.imagedata); Will occupy only the size of the image