Java tutorial
//package com.java2s; import android.graphics.drawable.Drawable; import android.widget.ImageView; public class Main { public static void setDrawable(ImageView imageView, Drawable drawable) { if (imageView != null && drawable != null) { imageView.setImageDrawable(drawable); } } }