Android Code Snippet Set any activity orientation (opposite to #SupportedOrientations)

Peter Simpson

Expert
Licensed User
SubName: Set any activity to the opposite orientation used in the app.
Description: Using this line of code in your manifest allows you to set one (or more) of your projects activities to a different orientation than the default one which is set in the Main activity using #SupportedOrientations.
B4X:
'Set activity to Landscape
SetActivityAttribute(<ActivityName>,
    android:screenOrientation,
    "landscape"
)
Tags: Rotate, Orientation, Activities, Manifest

Please note: I couldn't find this on the forum anywhere, so if it's already on here then I missed it.

Enjoy...
 
Last edited:

Serge Bertet

Member
Licensed User
ScreenOrientation possible values: unspecified, landscape, sensorLandscape, sensorPortrait or portrait.
 
Last edited:
Top