Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enable screen rotation android

I have disabled screen rotation in one activity in particular time. Now I need that particular time it will be enabled. How can I enable rotation, when i disabled it using this: ?

like image 526
Paulius Vindzigelskis Avatar asked May 25 '12 12:05

Paulius Vindzigelskis


2 Answers

You can use this

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);

See the official documentation for more details

like image 177
user219882 Avatar answered Sep 21 '22 01:09

user219882


Check out also that you don't have this line in your manifest file for your activity:

android:screenOrientation="portrait"

That will disable the rotate of the screen.

like image 43
limlim Avatar answered Sep 24 '22 01:09

limlim