I am using intent to launch camera:
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
getParent().startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
and using:
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
photoImage.setImageBitmap(thumbnail);
photoImage.setVisibility(View.VISIBLE);
But it is only a thumbnail, how do I get the full bitmap? I know I can use my own Activity and use:
Camera.PictureCallback()
But is there anyway to do it using Intent?
Thanks!
edit:
I also tried:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Uri uri = data.getData();
imageView.setImageURI(uri);
}
It works for photo selected from gallery, but for camera intent, data.getData() returns null.
Best Answer
To get full sized camera image you should point camera to save picture in temporary file, like:
Then after image capture intent finished to work - just grab your picture from
imageUri
using following code:P.S. Code need to be revised with respect to new security restriction applied in Android M - FileProvider:
mImageUri
has to be packed withFileProvider