Sujith Ks
Sujith Ks

Reputation: 360

I want my android application in landscape and portrait mode only?

I am developing one camera application.I want my application should be in landscape and portrait only.If mobile changes to reverse landscape, application should remain in portrait or landscape mode.And one thing is if device rotated to landscape application should change to landscape, and device changes to portrait, application changes to portrait.

Upvotes: 1

Views: 468

Answers (2)

gegobyte
gegobyte

Reputation: 5565

If you want Potrait Mode then:

<activity android:name=".ActivityName" android:screenOrientation="portrait" />

If you want Landscape Mode then:

<activity android:name=".ActivityName" android:screenOrientation="landscape" />

Upvotes: 1

Juan M. Rivero
Juan M. Rivero

Reputation: 807

You can use android:screenOrientation= locked on android manifest.

See: http://developer.android.com/guide/topics/manifest/activity-element.html for more info

Upvotes: 0

Related Questions