android之回收bitmap所占的内存空间

来源:互联网 发布:nba免费视频直播软件 编辑:程序博客网 时间:2024/05/04 13:35
/** * 回收bitmap所占的内存空间 */public static void recycleBitmap(Bitmap bitmap){if ( (bitmap != null) && ( ! bitmap.isRecycled()) ) {bitmap.recycle();bitmap = null ;System.gc();//告诉JVM回收内存,当然收不收由JVM决定System.out.println("***************bitmap.recycle()***************");}else {System.out.println("*********bitmap == null||bitmap.isRecycled()*******");}}

0 0