Clears all Bitmap data, that is, recycles the Bitmap and triggers the garbage collection. - Android Graphics

Android examples for Graphics:Bitmap Recycle

Description

Clears all Bitmap data, that is, recycles the Bitmap and triggers the garbage collection.

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

public class Main {
    /**/*from   w w w . j  a v a 2 s .  c om*/
     * Clears all Bitmap data, that is, recycles the Bitmap and 
     * triggers the garbage collection.
     * 
     * @param bm
     */
    public static void clearBitmap(Bitmap bm) {
        bm.recycle();
        System.gc();
    }
}

Related Tutorials