Page 1 of 1

Android: display orientation

Posted: Sun Jan 08, 2017 1:54 am
by zylesea
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?

Re: Android: display orientation

Posted: Sun Jan 08, 2017 5:22 am
by PEB
According to the documentation, GetAttribute(#DISPLAY, 1, #ATTRORIENTATION) should return #ORIENTATION_PORTRAIT, #ORIENTATION_LANDSCAPE, #ORIENTATION_PORTRAITREV, or #ORIENTATION_LANDSCAPEREV

Re: Android: display orientation

Posted: Sun Jan 08, 2017 10:46 pm
by zylesea
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.