New Module Activity to Landscape Only

bishmedia

Member
Licensed User
Longtime User
I have started a new module which opens a new activity which i want only to open in landscape, but when i add #SupportedOrientations: landscape i get an error..

B4X:
#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
    #SupportedOrientations: landscape
#End Region

Parsing code. Error
Error parsing program.
Error description: Attribute not supported: supportedorientations
Occurred on line: 4
#SupportedOrientations: landscape

How can i get a new activity window outside Main to load in Landscape only??
 

NJDude

Expert
Licensed User
Longtime User
This line:
B4X:
#SupportedOrientations: landscape

Works only on the Main activity, that's to define the orientation of the whole app.

If you want a specific activity on a different orientation you can add this line to the manifest:
B4X:
SetActivityAttribute(Settings, android:screenOrientation, "landscape")

On the line above, I'm assuming you have an activity named "Settings"

You can also use the Phone library and add SetOrientation
 
Upvote 0
Top