I set a data member, imageUri, and pass that into an intent that launches the camera activity. In the camera activity I take a picture and the rotate the screen before clic
I believe imageUri is a field in your activity, right? if you rotate the device the activity is destroyed and restarted, and your field is null. You have to save the URI as part of the state of your activity. There are a few possible methods to achieve that, on is to use onSaveInstanceState(), see here for more details: http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29
Istvan Jonyer. thank you very much.my problem solved. when i off auto rotate setting in my phone galaxy j510 j5 2016 and rotate camera in landscape i get error. but you help me. i add this code: android:configChanges="keyboardHidden|orientation|screenSize" to manifest file to tag my activity that start camera.
Locking the screen orientation of the invoking Activity fixed the issue for me. If you don't want to lock yours, you can create an Activity with locked orientation just for calling the camera, then returning the result to your 'real' activity.
To lock the screen orientation, put this into the activity definition in your manifest (both lines):
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"
"portrait" can also be "landscape"