Java tutorial
//package com.java2s; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { static Context mContext = null; public static final Bitmap resourceToBitmap(int id) { Resources res = mContext.getResources(); Bitmap bmp = BitmapFactory.decodeResource(res, id); return bmp; } }