This is described in the Android doc:
Public void setimageresource (int resId)
This is one of the methods, the parameter RESLD is this:
Imageview.setimageresource (R.drawable.icon);
Look at this passage.
Sets a drawable as the content of this ImageView.
This does Bitmap reading and decoding on the UI thread, which can cause a latency hiccup. If that ' s a concern, consider using setImageDrawable(Drawable) or setImageBitmap(Bitmap) and BitmapFactory instead.
This function uses the UI thread, which can be overridden in the following 3 ways:
ImageView IV;
String fileName = "/data/data/com.test/aa.png;
Bitmap BM = bitmapfactory.decodefile (fileName);
Iv.setimagebitmap (BM);
ImageView IV = new ImageView (context);
Iv.setimageresource (Iv[position]);
Iv.setscaletype (ImageView.ScaleType.FIT_XY);
Iv.setlayoutparams (New Gallery.layoutparams (136,88));
Mimageview = (ImageView) This.findviewbyid (R.ID.MYIMAGEVIEW1);
Mimageview.setimagedrawable (Getresources (). getdrawable (R.drawable.right)
Android Tutorial: ImageView setting up pictures