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 decodeResource(Context paramContext, Resources paramResources, int paramInt) { try { Bitmap localBitmap = BitmapFactory.decodeResource(paramResources, paramInt); return localBitmap; } catch (OutOfMemoryError localOutOfMemoryError) { } return null; } public static Bitmap decodeResource(Context paramContext, Resources paramResources, int paramInt, BitmapFactory.Options paramOptions) { try { Bitmap localBitmap = BitmapFactory.decodeResource(paramResources, paramInt, paramOptions); return localBitmap; } catch (OutOfMemoryError localOutOfMemoryError) { } return null; } }