Our camera takes about 10-15 seconds (due to the user equipment of the camera). I need 10-15 seconds during this process, I would not want the user to change the screen orientation.
I placed the takepicture call in the doInBackground of the Async task.
In the onPreExecute () method, I placed
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
And in onPostExecute I posted
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
This solution does not work for me and causes the camera and device to crash, and I had to reboot the device.
source
share