I am creating an application and part of it is where the user can change their profile picture either by taking a picture or using one from the native gallery.
So I'm using the native camera and I'm using the following lines of code to open the camera view
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image_saved_destination));
startActivityForResult(intent, CAMERA_REQUEST_CODE);
So with this it keeps overwriting the same file on the external storage.
This was working fine until I updated my os on one of my devices to lollipop. Now when I use the camera if I keep it in held in portrait and take the pic and save the orientation when it returns to my app flips from landscape to portrait. However, when the camera is open and if I hold the phone in landscape and take the pic and click save, it returns to the app with no orientation abnormalities.
Due to the orientation being changed and changed back I lose the state of the activity so my variables etc are lost, which are needed for processing the image data.
Has anyone encountered this?