In my android application I am capturing photo using Android default camera
for this purpose I have used below code.after captured a photo I have shown that Image into another activity in full screen mode.if I captured image in portrait
mode I can set the whole image into full screen mode. it showed good, after showed a image I can perform my operation.But if I captured a photo from landscape
the taken image would set in screen with stretched. so I would like to capture photo using portrait mode only not in landscape. so how may I lock camera app only for portrait.
String fileName = "Camera_Example.jpg";
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.TITLE, fileName);
values.put(MediaStore.Images.Media.DESCRIPTION,"Image capture by camera");
imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
startActivityForResult(intent,CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
AndroidManifest.xml
<activity
android:name=".TestActivity"
android:screenOrientation="portrait"
android:configChanges="orientation"
android:theme="@android:style/Theme.NoTitleBar" >
</activity>
portrait captured photo
portrait captured photo full screen
landscape captured photo
landscape captured photo full screen