Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { /** * Safely free a {@link Bitmap}. * * @param bmp * Object of bitmap. */ public final static void freeBitmap(Bitmap bmp) { if (null != bmp && !bmp.isRecycled()) { bmp.recycle(); } } }