How to disable orientation change (i.e only Landscape mode or only potrait mode) in android

If you want your android app not to change orientation when the user changes the orientation.

You can do it both programatically or updating the manifest file.

1) Updating the Manifest.

Just add this line to the activity that you want for a particular activity


It would look like 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s