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
怎么处理图片的加载问题???用完之后就立马释放????
求解决问题???
解决方案 »
- 关于android游戏开发引擎andengine的问题
- Android TextView 默认下最多能显示多少个文字?
- android使用spring httpInvoker无法解析xml文件
- 我发现onDraw()方法不断被调用?
- 触摸屏问题 [按键有KEY_DOWN 没有KEY_UP]
- 指定颜色去改变原有的照片颜色,请大家给点思路
- getApplicationContext意味着一个程序只有一个上下文?
- 两个fragment,都要调用同一个activity中的方法,怎么做?
- android application单例问题
- android模拟器里应用无法启动,贴出LOGCAT求前辈指点
- 线程的小问题,
- 请问新浪微博消息下载到本地后存储在哪儿呀?
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的问题了。