Can a few kind people test this code and see if it matches to what it says it should be. These are the values needed for my tablet, just checking if they're universal.
Phone library needed to be ticked/included.
If you test, can you comment whether they all match or only some.
Thanks.
Edit: Here's a zip containing example. View attachment Orientation.zip
Phone library needed to be ticked/included.
If you test, can you comment whether they all match or only some.
Thanks.
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Orient As ListView
Dim phn As Phone
End Sub
Sub Activity_Create(FirstTime As Boolean)
Orient.Initialize ("Orient")
Orient.AddSingleLine2("-1 = Auto (Sensor)",-1)
Orient.AddSingleLine2(" 0 = Landscape - Set",0)
Orient.AddSingleLine2(" 1 = Portrait - Set",1)
Orient.AddSingleLine2(" 6 = Landscape - Sensor",6)
Orient.AddSingleLine2(" 7 = Portrait - Sensor",7)
Orient.AddSingleLine2(" 8 = Reversed Landscape - Set",8)
Orient.AddSingleLine2(" 9 = Reversed Portrait - Set",9)
Activity.AddView(Orient,20,20,Activity.Width -40,Activity.Height-40)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Orient_ItemClick (Position As Int, Value As Object)
phn.SetScreenOrientation(Value)
End Sub
Edit: Here's a zip containing example. View attachment Orientation.zip
Last edited: