What is the SetScreenOrientation value for unspecified in the Phone library?
My app has several modules, one of which displays a map using osmdroid/mapview. Within that module (only) , I want to display an initial screen as landscape - but thereafter to "honour" the situation where a user rotates the device.
In the other modules, I want to force landscape all the time. I would like to achieve this programmatically using phone (or another equivalent) library.
I cannot use the #SupportedOrientations: parameter in Project Attributes as this applies across all modules all the time.
The Phone library documentation says:
SetScreenOrientation (Orientation As Int)
Changes the current activity orientation. This method cannot be called from a service module.
Orientation - -1 for unspecified, 0 for landscape and 1 for portrait.
The (very simple) code that I currently use is:
My app has several modules, one of which displays a map using osmdroid/mapview. Within that module (only) , I want to display an initial screen as landscape - but thereafter to "honour" the situation where a user rotates the device.
In the other modules, I want to force landscape all the time. I would like to achieve this programmatically using phone (or another equivalent) library.
I cannot use the #SupportedOrientations: parameter in Project Attributes as this applies across all modules all the time.
The Phone library documentation says:
Changes the current activity orientation. This method cannot be called from a service module.
Orientation - -1 for unspecified, 0 for landscape and 1 for portrait.
The (very simple) code that I currently use is:
B4X:
Sub Process_Globals
Dim phone1 As Phone
Sub Activity_Create(FirstTime As Boolean)
phone1.SetScreenOrientation(0) ' force landscape for map