急!android Bitmap.createBitmap 报内存溢出
报错信息如下所示:08-1211:31:50.676:E/dalvikvm-heap(22726):Outofmemoryona1843216-byteallocatio...
报错信息如下所示:
08-12 11:31:50.676: E/dalvikvm-heap(22726): Out of memory on a 1843216-byte allocation.
08-12 11:31:50.696: E/AndroidRuntime(22726): FATAL EXCEPTION: main
08-12 11:31:50.696: E/AndroidRuntime(22726): java.lang.OutOfMemoryError
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.nativeCreate(Native Method)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
08-12 11:31:50.696: E/AndroidRuntime(22726): at hh.book.id100001.view.ReadingBoard.onDraw(ReadingBoard.java:568)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.view.View.draw(View.java:13550) 展开
08-12 11:31:50.676: E/dalvikvm-heap(22726): Out of memory on a 1843216-byte allocation.
08-12 11:31:50.696: E/AndroidRuntime(22726): FATAL EXCEPTION: main
08-12 11:31:50.696: E/AndroidRuntime(22726): java.lang.OutOfMemoryError
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.nativeCreate(Native Method)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
08-12 11:31:50.696: E/AndroidRuntime(22726): at hh.book.id100001.view.ReadingBoard.onDraw(ReadingBoard.java:568)
08-12 11:31:50.696: E/AndroidRuntime(22726): at android.view.View.draw(View.java:13550) 展开
1个回答
展开全部
图片处理的时候很容易报OOM的错误,因此处理完图片后最好调用 recycle,
你可以参考一下:http://hi.baidu.com/ljlkings/item/c68d5c382986da677c034ba4
你可以参考一下:http://hi.baidu.com/ljlkings/item/c68d5c382986da677c034ba4
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询