Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Bitmap; import android.util.SparseArray; public class Main { public static void recycleBitmaps(SparseArray<Bitmap> bitmapSparseArray) { for (int i = 0; i < bitmapSparseArray.size(); i++) { Bitmap mBitmap = bitmapSparseArray.get(i); if (mBitmap != null) { mBitmap.recycle(); mBitmap = null; } } } }