Android: display orientation

Discuss any general programming issues here
Post Reply
zylesea
Posts: 167
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany
Contact:

Android: display orientation

Post by zylesea » Sun Jan 08, 2017 2:54 am

I know there is the event OrientationChange. But is there a way to get the current orientation of the display when there was no actual change? i mean it's pretty useful to know at the start of your program whether the display is in landscape or portait mode.
I tried with a screenshot at start, but height and width don't get changed dependently on orientation. checkevent() doesn't work too (well, there is no event to check) - any other ideas?

PEB
Posts: 168
Joined: Sun Feb 21, 2010 2:28 am

Re: Android: display orientation

Post by PEB » Sun Jan 08, 2017 6:22 am

According to the documentation, GetAttribute(#DISPLAY, 1, #ATTRORIENTATION) should return #ORIENTATION_PORTRAIT, #ORIENTATION_LANDSCAPE, #ORIENTATION_PORTRAITREV, or #ORIENTATION_LANDSCAPEREV

zylesea
Posts: 167
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany
Contact:

Re: Android: display orientation

Post by zylesea » Sun Jan 08, 2017 11:46 pm

PEB wrote:According to the documentation, GetAttribute(#DISPLAY, 1, #ATTRORIENTATION) should return #ORIENTATION_PORTRAIT, #ORIENTATION_LANDSCAPE, #ORIENTATION_PORTRAITREV, or #ORIENTATION_LANDSCAPEREV
A big thank you for pointing me there. I had overseen that before and was attempting this and that to gather the information.

Post Reply