08-06 11:35:01.851: E/AndroidRuntime(10736): FATAL EXCEPTION: main
08-06 11:35:01.851: E/AndroidRuntime(10736): java.lang.OutOfMemoryError
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:582)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:380)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:413)
08-06 11:35:01.851: E/AndroidRuntime(10736): at com.accusol.realestate.property.Property3AddFragmentActivity.onClick(Property3AddFragmentActivity.java:812)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.view.View.performClick(View.java:3558)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.view.View$PerformClick.run(View.java:14157)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.os.Handler.handleCallback(Handler.java:605)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.os.Handler.dispatchMessage(Handler.java:92)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.os.Looper.loop(Looper.java:137)
08-06 11:35:01.851: E/AndroidRuntime(10736): at android.app.ActivityThread.main(ActivityThread.java:4514)
08-06 11:35:01.851: E/AndroidRuntime(10736): at java.lang.reflect.Method.invokeNative(Native Method)
08-06 11:35:01.851: E/AndroidRuntime(10736): at java.lang.reflect.Method.invoke(Method.java:511)
08-06 11:35:01.851: E/AndroidRuntime(10736): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
08-06 11:35:01.851: E/AndroidRuntime(10736): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
08-06 11:35:01.851: E/AndroidRuntime(10736): at dalvik.system.NativeStart.main(Native Method)
我用下面的代码来显示图像
vi = inflator.inflate(R.layout.item_image, null);
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageVIew imgeview=(ImageVIew )vi.findViewById(R.id.imgItem);
imgeview.setImageBitmap(myBitmap);
vi.setTag(i);
这是在 brimapFactory.decodFile 中出现的问题...当有大图像文件时