Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; public class Main { @SuppressWarnings("deprecation") public static Drawable getConvertDrawable(String filepath) { Bitmap bitmap = BitmapFactory.decodeFile(filepath); Drawable drawable = new BitmapDrawable(bitmap); return drawable; } }