Hi I am letting the user select an image from their Photo library and edit it using my app. The photo selection intent works great and I get the URI of the selected image, but as soon as I make a call to Media.getBitmap to get the selected image from the Uri, I get an OutOfMemory exception.
This is a fairly simple thing I am trying to do and there is no other processing which takes place before the image is shown, just initializations. So I really don't understand the cause of this error. Here's the stacktrace 06-20 11:06:00.158: DEBUG/AndroidRuntime(205): Shutting down VM 06-20 11:06:00.158: WARN/dalvikvm(205): threadid=3: thread exiting with uncaught exception (group=0x40010e28) 06-20 11:06:00.158: ERROR/AndroidRuntime(205): Uncaught handler: thread main exiting due to uncaught exception 06-20 11:06:00.268: ERROR/AndroidRuntime(205): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:328) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:213) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at com.android.myProj.ShowImageActivity.onCreate(ShowImageActivity.java: 101) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1122) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2103) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2156) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.os.Handler.dispatchMessage(Handler.java:88) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.os.Looper.loop(Looper.java:123) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at android.app.ActivityThread.main(ActivityThread.java:3742) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at java.lang.reflect.Method.invokeNative(Native Method) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at java.lang.reflect.Method.invoke(Method.java:515) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:739) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497) 06-20 11:06:00.268: ERROR/AndroidRuntime(205): at dalvik.system.NativeStart.main(Native Method) 06-20 11:06:00.339: INFO/Process(51): Sending signal. PID: 205 SIG: 3 Any insights as to what could be wrong? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

