Sep 22, 2019 With reference to this thread: https://www.b4x.com/android/forum/threads/detect-current-orientation.109829/ This sub will assist you to determine the current orientation of your activity. I noticed that the solutions to this one on the forum are quite complicated or resource intensive. Here is a Sub you can use, which is very simple and uses minimal resources. Hope it helps someone. Code: Copy Sub DetermineCurrentScreenOrientation As String Dim orientation As String If Activity.Height > Activity.Width Then orientation = "portrait" Else orientation = "landscape" End If Return orientation End Sub Click to expand...
With reference to this thread: https://www.b4x.com/android/forum/threads/detect-current-orientation.109829/ This sub will assist you to determine the current orientation of your activity. I noticed that the solutions to this one on the forum are quite complicated or resource intensive. Here is a Sub you can use, which is very simple and uses minimal resources. Hope it helps someone. Code: Copy Sub DetermineCurrentScreenOrientation As String Dim orientation As String If Activity.Height > Activity.Width Then orientation = "portrait" Else orientation = "landscape" End If Return orientation End Sub