In my android app, after clicking on button I want camera to open in landscape mode. Even if I rotate my mobile into portrait mode, camera should always be in landscape mode or in portrait mode
Use This code for open camera in landscape mode
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
File f = new File(Environment.getExternalStorageDirectory(), "temp.jpg");
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
startActivityForResult(cameraIntent, Utils.CAMERA__CROP_REQUEST);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With