还是在CoverFlow实现上报错

刘飞3002 发布于 2012/03/14 10:36
阅读 486
收藏 0

还是在实现coverflow过程中,出现的lodcat如下:

03-14 02:27:11.014: ERROR/AndroidRuntime(275): FATAL EXCEPTION: main

03-14 02:27:11.014: ERROR/AndroidRuntime(275): java.lang.OutOfMemoryError: bitmap size exceeds VM budget

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.graphics.Bitmap.nativeCreate(Native Method)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at lf.My.CoverFlow.ImageAdapter.createReflectedImages(ImageAdapter.java:74)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at lf.My.CoverFlow.ImageAdapter.getView(ImageAdapter.java:47)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.Gallery.makeAndAddView(Gallery.java:745)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.Gallery.fillToGalleryLeft(Gallery.java:664)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.Gallery.layout(Gallery.java:629)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.Gallery.onLayout(Gallery.java:336)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.View.layout(View.java:7035)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.View.layout(View.java:7035)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.View.layout(View.java:7035)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.View.layout(View.java:7035)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.os.Handler.dispatchMessage(Handler.java:99)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.os.Looper.loop(Looper.java:123)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at android.app.ActivityThread.main(ActivityThread.java:4627)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at java.lang.reflect.Method.invokeNative(Native Method)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at java.lang.reflect.Method.invoke(Method.java:521)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

03-14 02:27:11.014: ERROR/AndroidRuntime(275):     at dalvik.system.NativeStart.main(Native Method)

03-14 02:28:09.634: ERROR/dalvikvm-heap(313): 3538944-byte external allocation too large for this process.

03-14 02:28:09.634: ERROR/GraphicsJNI(313): VM won't let us allocate 3538944 bytes

03-14 02:28:09.654: ERROR/AndroidRuntime(313): FATAL EXCEPTION: main

03-14 02:28:09.654: ERROR/AndroidRuntime(313): java.lang.OutOfMemoryError: bitmap size exceeds VM budget

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.graphics.Bitmap.nativeCreate(Native Method)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at lf.My.CoverFlow.ImageAdapter.createReflectedImages(ImageAdapter.java:74)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at lf.My.CoverFlow.ImageAdapter.getView(ImageAdapter.java:47)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.Gallery.makeAndAddView(Gallery.java:745)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.Gallery.fillToGalleryLeft(Gallery.java:664)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.Gallery.layout(Gallery.java:629)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.Gallery.onLayout(Gallery.java:336)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.View.layout(View.java:7035)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.View.layout(View.java:7035)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.View.layout(View.java:7035)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.View.layout(View.java:7035)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.os.Handler.dispatchMessage(Handler.java:99)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.os.Looper.loop(Looper.java:123)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at android.app.ActivityThread.main(ActivityThread.java:4627)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at java.lang.reflect.Method.invokeNative(Native Method)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at java.lang.reflect.Method.invoke(Method.java:521)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

03-14 02:28:09.654: ERROR/AndroidRuntime(313):     at dalvik.system.NativeStart.main(Native Method)

我已经将我的代码与楼主的进行了比对,没发现什么不同,除了在layout文件里比楼主多一个main.xml,可这是怎么了呢??求解!!!

加载中
0
迷途d书童
迷途d书童
换几张小图片试试,可能图片太大了,内存溢出。
刘飞3002
刘飞3002
我主要是想知道自己错在哪里,嘿嘿,学习编程语言嘛,就是要改错滴。
迷途d书童
迷途d书童
@刘飞3002 : 你就运行我的项目看看,我的在虚拟机和真机上都没问题。
刘飞3002
刘飞3002
虚拟机
迷途d书童
迷途d书童
@刘飞3002 : 是在真机上有问题吗?
刘飞3002
刘飞3002
可是我把你的原码也import进去了。在同一个AVD上都能运行,起初我也怀疑是图片太大,可换为你的图片还是同样报错啊。
返回顶部
顶部