Check for switch between landscape and horizontal

carchek

Member
Licensed User
Longtime User
Hi!
I am new member here. :)
I have a question, since I am new to Android (I know VB language). I am developing an application, that will be able to check for switch between horizontal and landscape position of the telephone. :o
Can you please give me any guidelines so I can learn more about it. :)
Thanks in advance,
Carchek
 
You mean to detect if the device is in Portrait or Landscape?

If the answer is yes then you can do something like this:

Code: Copy
If Activity.Width > Activity.Height Then

   Msgbox("Landscape", "")

Else

   Msgbox("Portrait", "")

End If
 
Upvote 0
You mean to detect if the device is in Portrait or Landscape?

If the answer is yes then you can do something like this:

Code: Copy
If Activity.Width > Activity.Height Then

   Msgbox("Landscape", "")

Else

   Msgbox("Portrait", "")

End If

Thank you! :) :sign0008:
 
Upvote 0
Back
Top