Action_image_capture Onactivityresult Has Empty Intent With Empty Data
After reading this documentation https://developer.android.com/training/camera/photobasics I want to take a photo and to store the uri of the photo into a given variable. The probl
Solution 1:
You already have photoURI
which you send with MediaStore.EXTRA_OUTPUT
so You can simply use it . Save photoURI
as globally and directly use it . See if RESULT_OK
is emitted then it means picture was clicked and it will be saved at the EXTRA_OUTPUT
location.
publicvoidonActivityResult(int requestCode, int resultCode, Intent intent){
if( requestCode == Constants.REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK){
// USe photoURi here
}
}
You can not expect some custom key which is Constants.INTENT_EXTRA_VARNAME
will be return with System camera Intent. I do not have any knowledge of such thing.
If you specified MediaStore.EXTRA_OUTPUT
the image taken will be written to that path, and no data will given to onActivityResult
so you need to persist the file path.
PS : You can save it globally and also make sure you should persist it during onSaveInstanceState()
.
Post a Comment for "Action_image_capture Onactivityresult Has Empty Intent With Empty Data"