private ImageView imageView;
imageView = (ImageView)findViewById(R.id.image);
//获得图片:
//方式一:直接从res中取图片
image.setImageResource(R.drawable.ic_launcher);
//方式二:通过Bitmap对象,通过bitMap工厂进行解码
Bitmap bitMap = BitmapFactory.decodeResource(getResources(), R.drawable.ha);
image.setImageBitmap(bitMap);
//方式三:通过Drawable对象
Drawable drawable = getResources().getDrawable(R.drawable.ha);
image.setImageDrawable(drawable);