If Activity.Height > Activity.Width Then
'For Portrait done
msgbox(GetOrientation ,"")
Else
'For Landscape done
msgbox(GetOrientation ,"")
End If
Sub GetOrientation As Int 'Erel's function
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "window", "java.lang.String")
r.Target = r.RunMethod("getDefaultDisplay")
Return r.RunMethod("getOrientation")
End Sub