Hello, I want to let you change the screen orientation only when it is a tablet, how I can do this?
Thanks and regards.
B4X:
#Region Project Attributes
#SupportedOrientations: portrait
#End Region
Sub Process_Globals
Dim bIsTablet As Boolean = False
End Sub
Sub Activity_Create(FirstTime As Boolean)
If GetDevicePhysicalSize > 6 Then ' 7" o 10" tablet
bIsTablet = True
'
#SupportedOrientations = unspecified ' <-- how I can do this?
'
End If
End Sub
Sub GetDevicePhysicalSize As Float
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
Return Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2))
End Sub