Reputation: 6191
I am using an application for meditation on daily basis, today i was surprised by it because when i rotate screen, App goes to landscape mode, Although the Automatic rotation was off from my settings, How it can happen?
Is there something like Force device to change orientation?
And If default device rotation is off then how app can know that device orientation is changed?
I double checked my phones settings of Auto-Rotation and they were off.I am using Kitkat device.
Upvotes: 1
Views: 112
Reputation: 51
Yes. you can.
in onCreate
method type
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
this will do the magic.
Upvotes: 1
Reputation: 159
In AndroidManifest.xml
file set activity tag, screenOrientation
attribute to fullSensor
like this:
<activity
android:name=".MyActivity"
android:screenOrientation="fullSensor" />
Upvotes: 1