Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Bitmap; public class Main { /** * Recycle the bitmap with null checks. * If the bitmap is already recycled, do nothing. * * @param bitmap to recycle. */ public static void recycle(Bitmap bitmap) { if (bitmap == null || bitmap.isRecycled()) { return; } bitmap.recycle(); } }