How to lock the camera app orientation called through intent in android?

view full story

http://stackoverflow.com – I want to open the native camera app through intent in my application. I have used the following lines of code. Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f)); startActivityForResult(takePictureIntent, actionCode); Now, I want to lock the orientation of camera in portrait when it is opened. I just added the below line to the above piece of code. takePictureIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); But, it is not working. T (HowTos)