Android – Camera Image Capture Intent fails to return in Galaxy Tab Limited Edition

androidandroid-3.0-honeycombcameratablet

I'm having problems with a Galaxy Tab Limited Edition ( Google I/O ) when I open the camera whit an Intent.

This is my code:

Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new     
    File(mSavedFilePath)));
startActivityForResult(imageCaptureIntent, REQUEST_IMAGE_CAPTURE);

On a Motorola Xoom this code is working fine.
But on Galaxy Tab 10.1, never I receive the response from the camera app.

I haven't a stack trace because i haven't an error.

Anyone have any idea?

Best Answer

You don't need the camera permission when launching an intent to the camera app. However this is a highly fragmented process on the android platform. i have had a lot of issues with it. basically if you check the extra file that you sent to the camera app you will notice that his size is 0 bytes when the result returns. this bug exists in a lot of android devices and thee is a workaround to fixing most of it and that is when this fails (this means there is no parceable extra output returned and if it is then the extra file is not created or with lenght 0 then you need to get the Uri from the intent like: intent.getData(); this will return an uri to the file which is basically formed the same way as the Extra Output Uri so you can afterwards use the same approach for obtaining the image.

You will notice the image is stored within the Media.Images provider and in the camera directory and ofc the intent.getData() Uri pointing in there.

Hope this helps. Don't forget to vote :D.

Related Topic