Sub Activity_Create(FirstTime As Boolean)
ScrnOrientVal = StateManager.GetSetting2("ScrnOrientVal", 1)
Private SR As Double
If ScrnOrientVal = 0 Then
SR = (Max(100%y,100%x))/(Min(100%y,100%x))
If SR < 1.6 Then
Activity.LoadLayout("landscape")
Log("SR Pre = "&SR)
Else
Activity.LoadLayout("landscape2")
End If
Else
Log("6")
Activity.LoadLayout("portrait")
End If