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 { public static Bitmap getBitmapFromResources(Context context, int resId) { Resources res = context.getResources(); return BitmapFactory.decodeResource(res, resId); } }