0

first, sorry for my English, it's not very good. I'm trying to select photo from gallery. All it's ok in this step. When I select the photo, on ActiviyResult get the Uri of the image and set an ImageView with setImageUri. But in the second try, when I set ImageUri this throw an exception. The Uri not is null, and if I set a TextView with the path this works.

anyone knowks what is happening?

danybarco
  • 308
  • 2
  • 9
  • 1
    Can you post exception that is thrown ?.' – Kartik Domadiya Oct 25 '11 at 10:33
  • Post the exception and code that generating exception as Karthik said – Tofeeq Ahmad Oct 25 '11 at 10:42
  • I try to get the exception with an try catch block but anyway it throws the exception. It occurs when I set image with setImageUri. – danybarco Oct 25 '11 at 11:06
  • Copy and paste the logcat to show us what the exception is.So we can help. I guess you may encounter the OutOfMemory exception. – Huang Oct 25 '11 at 11:47
  • This is my logcat 10-26 11:15:35.191: ERROR/GraphicsJNI(18836): VM won't let us allocate 8045568 bytes 10-26 11:15:35.191: ERROR/AndroidRuntime(18836): FATAL EXCEPTION: main 10-26 11:15:35.191: ERROR/AndroidRuntime(18836): **java.lang.OutOfMemoryError**: bitmap size exceeds VM budget 10-26 11:15:35.191: ERROR/AndroidRuntime(18836): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) – danybarco Oct 26 '11 at 10:13
  • I think Huang are right, it's a OutOfMemory exception, but,how do I fix it? – danybarco Oct 26 '11 at 10:16
  • Finally I find the answer in this post http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue – danybarco Oct 27 '11 at 17:50

0 Answers0