Activity中bitmap的回收
来源:互联网 发布:九连拍软件叫什么软件 编辑:程序博客网 时间:2024/09/21 09:23
1.Activity中Bitmap的回收
public void recycleAllImages () {
Logger.d("---------recycleView=====::" + getClass().getSimpleName());
View decorView = getWindow().getDecorView();
recycleViewImages(decorView);
}
2.View中Bitmap的回收
if (view == null) {
return ;
}
Logger.d("---------recycleView=====:" + view.getClass().getSimpleName());
Drawable bgDrawable = view.getBackground();
if (bgDrawable != null && bgDrawable instanceof BitmapDrawable) {
BitmapDrawable bd = (BitmapDrawable) bgDrawable;
if (bd != null) {
if (bd.getBitmap() != null) {
bd.getBitmap().recycle();
}
}
}
if (view instanceof ViewGroup) {
ViewGroup group = (ViewGroup) view;
for (int i=0; i<group.getChildCount(); i++) {
recycleViewImages(group.getChildAt(i));
}
} else {
if (view instanceof ImageView || view instanceof ImageButton) {
ImageView iv = (ImageView) view;
Drawable drawable = iv.getDrawable();
if (drawable != null && drawable instanceof BitmapDrawable) {
BitmapDrawable bd = (BitmapDrawable) drawable;
if (bd != null) {
if (bd.getBitmap() != null) {
bd.getBitmap().recycle();
}
}
}
}
}
}
0 0
- Activity中bitmap的回收
- Bitmap的回收
- 关于Android 中 Bitmap 内存回收的一点心得
- 回收bitmap后的ImageView,activity死前的回调方法
- 关于bitmap回收的问题
- 强制回收ImageView的bitmap
- 关于bitmap的回收问题
- Android OOM ,回收布局文件中ImageView占用的内存.Bitmap OOM回收解决.
- Bitmap回收
- bitmap 回收
- Bitmap回收
- 回收bitmap
- 恢复系统回收activity中存在的数据和状态
- 如何解决lrucache不能从内存中回收bitmap
- Activity间传递Bitmap,startActivityForResult的用法
- activity间传送bitmap的办法
- bitmap资源回收问题
- Android Bitmap回收 注意事项
- 三种编译技术比较
- PyQt+OpenCV 录制保存、播放视频
- java环境变量配置
- Outline Extractor Error: Essbase runtime client not installed. esbapin.dll
- Fiddler跟踪监控android数据包
- Activity中bitmap的回收
- Tomcat配置加载war包运行APPWeb
- Arduino系列教程-018 液晶文字显示
- Spring+Hibernage通过jdbc.properties配置
- Activity生命周期
- VC++2010开发数字图像系统1
- Visual Studio 2010下opencv的配置方法
- win7下安装配置MinGW编译器
- Windows7命令窗口下MinGW编译C++源文件