ChickenVN91
ChickenVN91

Reputation: 182

How to rotate home screen

I used:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

But only current screen is changed. I want to change orientation of all screens on device. How to rotate the home screen?

Upvotes: 1

Views: 9382

Answers (4)

Lakhwinder Singh
Lakhwinder Singh

Reputation: 7209

Please try this in your every activity in the manifest declaration

<activity android:name=".YourActivity"
        android:configChanges="orientation"
        android:screenOrientation="fullSensor"/>

This will rotate your screen if the device is rotated and the device orientation is set to auto

Upvotes: 0

Jitendra Kumar. Balla
Jitendra Kumar. Balla

Reputation: 1213

What I understand from your qus is, you want to change orientation for all apps, If Am I correct, then you can't change rotation all the apps orientation in android, but you can change orientation in your app.

Upvotes: 0

Aditya Vyas-Lakhan
Aditya Vyas-Lakhan

Reputation: 13555

In your manifest file of your project just add this way with activity tag

<activity android:name=".YourActivity"
    android:configChanges="orientation"
    android:screenOrientation="portrait"/>

and if you want your screen in particular orientation then add above properties in all activity tag..

Upvotes: 0

Ve Pham
Ve Pham

Reputation: 303

Setting -> and select Screen rotation

Upvotes: 1

Related Questions