Java tutorial
//package com.java2s; import android.graphics.Bitmap; public class Main { private final static void recycle(Bitmap... bitmaps) { if (bitmaps == null || bitmaps.length == 0) { return; } for (Bitmap bitmap : bitmaps) { if (bitmap == null) { continue; } if (!bitmap.isRecycled()) { bitmap.recycle(); continue; } bitmap = null; } System.gc(); } }