1.6 crashes on taking photo

All your problems with Audio, Video and Images.

1.6 crashes on taking photo

Postby Droid123 » Tue Jan 12, 2010 11:14 am

Hi all,

I need some help. I have an app that allows the user to take a picture (with MediaStore.ACTION_IMAGE_CAPTURE).
In onActivityResult, I extract the uri to the image that was taken (with uri = data.getdata())

This works properly on Android 1.5, but it crashes on 1.6 (and also 2.0). It seems that the picture was never taken and I get a nullpointerException on data.getdata() since it is null.
I'm testing on actual hardware (Hero for 1.5, G1 for 1.6, Milestone/Droid for 2.0) so it has nothing to do with the emulator.

Does anyone know what changed in 1.6???
I have included the permission android.permission.WRITE_EXTERNAL_STORAGE that is new in 1.6, anything else?
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top

Postby Droid123 » Tue Jan 12, 2010 1:41 pm

Ok so I solved it.

This thread was really helpful:

http://www.mail-archive.com/android-dev ... 70657.html

Apparently, the HTC Hero is "Special" when it comes down to the camera app. It returns an URI to the image location that it saves in a default location, whereas other phones don't.... seems like a bug in Android to me
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests