我有一个问题是 1MB 的 jpg 图像变成 12 MB 的位图?我只是在做一个在 ImageView (全屏)中加载 1MB 的大图像的屏幕碎裂,我收到了这个错误:
Grow heap (frag case) to 27.724MB for 12582928-byte allocation
08-14 21:31:13.302: I/dalvikvm(15434): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-14 21:31:13.302: I/dalvikvm(15434): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:594)
08-14 21:31:13.302: I/dalvikvm(15434): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:447)
08-14 21:31:13.312: I/dalvikvm(15434): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
08-14 21:31:13.312: I/dalvikvm(15434): at android.content.res.Resources.loadDrawable(Resources.java:1963)
08-14 21:31:13.312: I/dalvikvm(15434): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
08-14 21:31:13.312: I/dalvikvm(15434): at android.widget.ImageView.<init>(ImageView.java:120)
08-14 21:31:13.312: I/dalvikvm(15434): at android.widget.ImageView.<init>(ImageView.java:110)
08-14 21:31:13.312: I/dalvikvm(15434): at java.lang.reflect.Constructor.constructNative(Native Method)
08-14 21:31:13.312: I/dalvikvm(15434): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-14 21:31:13.322: I/dalvikvm(15434): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-14 21:31:13.322: I/dalvikvm(15434): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-14 21:31:13.322: I/dalvikvm(15434): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:316)
08-14 21:31:13.322: I/dalvikvm(15434): at android.app.Activity.setContentView(Activity.java:1901)