Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / GetOrientation() gives wrong result at startup

Peter Stampfli
Years of Service
User Offline
Joined: 16th Aug 2016
Posted: 16th Aug 2016 20:17
I create an application with different layouts for mobile devices hold in portrait or landscape mode. At startup I use GetOrientation(). With broadcasting all works well. But exporting as an Android application GetOrientation() gives always 1 for some time after startup even if the device is hold in landscape orientation. You can test this with this script:

Broadcasting, I get for a device in landscape orientation

start orientation 3
frames 0
new 3

Thus GetOrientation() gives the correct result and an app would show the layout for landscape mode.

Exporting as a Android app and running it I get:

start orientation 1
frames 47
now 3

Thus GetOrientation() WRONGLY returns at startup that the device is in portrait orientation. The app then uses the wrong layout. Thus it cannot be used if the device is in landscape orientation as it is often the case for larger tablets.

This is a SERIOUS BUG and breaks my work.

Can anyone help me?

Thanks for your attention.

Sincerely yours
Peter Stampfli

Login to post a reply

Server time is: 2019-07-19 06:27:12
Your offset time is: 2019-07-19 06:27:12