Android: display orientation

Discuss any general programming issues here

Android: display orientation

Postby 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?
zylesea
 
Posts: 139
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany

Re: Android: display orientation

Postby 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
PEB
 
Posts: 142
Joined: Sun Feb 21, 2010 2:28 am

Re: Android: display orientation

Postby 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.
zylesea
 
Posts: 139
Joined: Tue Feb 16, 2010 1:50 am
Location: Westfalen/Germany


Return to General programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron