release Bitmap - Android Graphics

Android examples for Graphics:Bitmap Recycle

Description

release Bitmap

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

public class Main {

    public static void release(Bitmap... bitmaps) {
        if (bitmaps != null) {
            try {
                for (Bitmap bitmap : bitmaps) {
                    if (bitmap != null && !bitmap.isRecycled()) {
                        bitmap.recycle();
                    }/*from   w  w w  .  j  a  v  a  2  s.  c o m*/
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

Related Tutorials