10-12 10:47:58.208: ERROR/AndroidRuntime(279): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
10-12 10:47:58.208: ERROR/AndroidRuntime(279): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
怎么处理图片的加载问题???用完之后就立马释放????
求解决问题???
10-12 10:47:58.208: ERROR/AndroidRuntime(279): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
怎么处理图片的加载问题???用完之后就立马释放????
求解决问题???
解决方案 »
- 求android2.3.5里面的build/target/product/security/platform.x509.pem和platform.pk8两个文件
- 一次性写满sdcard的办法
- 开发手机上的程序和平板电脑上的程序有什么不一样
- 自己编译android2.2源码生成sdk,使用时sdcard不能用,什么权限都没有。
- Android中使用ListView 在虚拟机中运行会出现位置混乱现象
- android拍照程序的问题
- 关于Tomcat的简单问题,虽然很弱,但是还是来问下
- Android studio 安装问题 大神戳进来
- 融云eclipse集成 demo项目出现的问题,求大神指导
- 有大神研究Android APP连接UVC摄像头的吗,怎么获取提取使用视频流啊
- 线程的小问题,
- 请问新浪微博消息下载到本地后存储在哪儿呀?
if(null!=bmb&&!bmb.isRecycled())
bmb.recycle();
}
最好的解决方案是在自定义的View中添加一个init()初始化方法的头部调用.或者在构造函数的顶部调用:public class GifView extends View implements Runnable {
private Bitmap bmb; public GifView(Context context, InputStream inputStream) {
super(context);
distoryBitmap();
bmb = BitmapFactory.decodeStream(is);
}
}
* Try using the context-application instead of a context-activity
* Avoid non-static inner classes in an activity if you don't control their life cycle, use a static inner class and make a weak reference to the activity inside. The solution to this issue is to use a static inner class with a WeakReference to the outer class, as done in ViewRoot and its W inner class for instance
* A garbage collector is not an insurance against memory leaks目前一般尽量避免oom的方法有:1,设置options
2,使用软引用
3,手动recycle
4,设置Bitmap RGB_565
5,设置系统堆大小
这个也许就能解决lz的问题了。