shiva
shiva

Reputation: 21

how to avoid camera landscape mode in android?

HI

I am New To android, my problem is when iam capturing image programetically the camera is opening in landscape mode..Than How to Avoid it?

Can anyone help me

Thanks in advance

Upvotes: 0

Views: 1107

Answers (2)

Dhruvisha
Dhruvisha

Reputation: 2530

You can set above line in your androidmanifest.xml

<activity android:name=".activityname" android:orientation="portrait"/>

This will open your camera activity in portrait mode only.

Upvotes: 1

Piyush
Piyush

Reputation: 2609

I think you should use

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

in your camera class.

Upvotes: 3

Related Questions