flash - air android app always launches in portrait mode irrespective of the way the android device is held ( landscape/portrait) -


i have air android app running on android device ( samsung tab ). want app laid out in landscape mode when user starts app holding device in landscape ( same goes portrait ).

but air app gets started in portrait mode irrespective of way device held.

i tried following ways -

  1. use stage.deviceorientation (but when app starts (after applicationcomplete notification ) value unknown)

  2. use stage resize event. (this gets triggered @ start itself, manual resize not required - values based on portrait mode though - width 600 , height 1024 (should have been otherway) )

i correct values when try changing orientation of device, @ startup see problem required values.

could please advice on problem ?

thanks

use getresources().getconfiguration().orientation.

link here

if(mycurrentactivity.getresources().getconfiguration().orientation == configuration.orientation_portrait)  {     // code portrait mode } else {     // code landscape mode          } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -