i have a android application where i tae a picture in a intend like this:
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
startActivityForResult(takePictureIntent, actionCode);
then i fill a ImageView with the result.
now i found a bug, then i want to take a picture and during the camera is open i rotate the screen and take the picture, i dont get a result in my ImageView.
Only when not rotating the camera, while taking a picture i see it in the ImageView.
how to solve this?
I assume you have a get results method.
Make sure your file location hasnt been cleaned because of rotate(aka you are looking in the wrong place).
I had this problem. I was setting a global variable of where to save the photo to.
I passed this to the intent to take photo, and on return looked at that location to display photo.
However, if you rotate the screen, the global variable is destroyed, and so on result, it no longer knows where to find the photo.
The best thing to do is to save it to the saved instance, and reinitialse location
onResumefrom thesavedInstance.See here on how to do it.