Android: display orientation

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

Android: display orientation

Post 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?
PEB
Posts: 569
Joined: Sun Feb 21, 2010 1:28 am

Re: Android: display orientation

Post by PEB »

According to the documentation, GetAttribute(#DISPLAY, 1, #ATTRORIENTATION) should return #ORIENTATION_PORTRAIT, #ORIENTATION_LANDSCAPE, #ORIENTATION_PORTRAITREV, or #ORIENTATION_LANDSCAPEREV
zylesea
Posts: 227
Joined: Tue Feb 16, 2010 12:50 am
Location: Westfalen/Germany
Contact:

Re: Android: display orientation

Post 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.
Post Reply