Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { /** * Recycle the bitmp if it is not null or recycled. * * @param bmp * the bitmap will be recycled for retrieving its memory */ public static void recycleBitmap(Bitmap bmp) { if (bmp == null || bmp.isRecycled()) return; // if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { bmp.recycle(); // } } }