Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; public class Main { public static Drawable bitmap2drawable(Resources res, Bitmap bitmap) { if (res == null || bitmap == null) { return null; } BitmapDrawable bd = new BitmapDrawable(res, bitmap); return bd; } }