我创建了一个仅包含 ImageViews 的应用程序。
此外,根据应用程序要求,我必须使用分辨率为 1024*780 到 200*250 分辨率的高品质图像。所有图像总计近 45 张图像!!!。
在高端(堆内存> = 32)设备中,我发现它运行平稳,进入低端(堆内存<32)设备以及MICROMAX A 65,我收到了一些崩溃报告并尝试了一个 16mb 堆内存模拟器。
单击第一个图像后,它显示:
06-29 05:16:28.572: W/dalvikvm(846): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
06-29 05:16:28.665: E/AndroidRuntime(846): FATAL EXCEPTION: main
06-29 05:16:28.665: E/AndroidRuntime(846): java.lang.OutOfMemoryError
06-29 05:16:28.665: E/AndroidRuntime(846): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.content.res.Resources.loadDrawable(Resources.java:1965)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.content.res.Resources.getDrawable(Resources.java:660)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.widget.ImageView.resolveUri(ImageView.java:616)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.widget.ImageView.setImageResource(ImageView.java:349)
06-29 05:16:28.665: E/AndroidRuntime(846): at com.mshah.learnandplaybasiccolors.Learn.setImageWithSound(Learn.java:123)
06-29 05:16:28.665: E/AndroidRuntime(846): at com.mshah.learnandplaybasiccolors.Learn.onClick(Learn.java:88)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.view.View.performClick(View.java:4202)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.view.View$PerformClick.run(View.java:17340)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.os.Handler.handleCallback(Handler.java:725)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.os.Handler.dispatchMessage(Handler.java:92)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.os.Looper.loop(Looper.java:137)
06-29 05:16:28.665: E/AndroidRuntime(846): at android.app.ActivityThread.main(ActivityThread.java:5039)
06-29 05:16:28.665: E/AndroidRuntime(846): at java.lang.reflect.Method.invokeNative(Native Method)
06-29 05:16:28.665: E/AndroidRuntime(846): at java.lang.reflect.Method.invoke(Method.java:511)
06-29 05:16:28.665: E/AndroidRuntime(846): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-29 05:16:28.665: E/AndroidRuntime(846): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-29 05:16:28.665: E/AndroidRuntime(846): at dalvik.system.NativeStart.main(Native Method)
我没有使用位图,它给出了位图错误:我该如何解决这个错误???
或者
我应该排除对此类设备的支持吗?