判断ImageView图片是否存在,未加载成功,就显示默认图片。 [java] view plain copy print ? if (mPhotoView.getDrawable() == null) { Toast.makeText(getActivity(), "图片加载失败", Toast.LENGTH_SHORT).show(); mPhotoView.setImageDrawable(getResources().getDrawable(R.drawable.icon_default_user_photo)); } Android中Bitmap, Drawable, Byte,ID之间的转化 1. Bitmap 转化为 byte