Skip to main content
Participant
July 5, 2013
Question

AIR ANDROID - app starts up in landscape ok but reverts to portrait after returning from sleep/lock

  • July 5, 2013
  • 1 reply
  • 1059 views

Testing on Samsung Galaxy  with auto orients false, fullscreen and aspect ratio set to landscape all work well on startup. After the device returns from sleep the app is in portrait mode and fills half the screen.

Suggestions for on activation ...

stage.setOrientation(StageOrientation.ROTATED_RIGHT);  or
stage.setAspectRatio(StageAspectRatio.LANDSCAPE);

try to work but stall the device requiring a reboot.

I've had to turn on auto orientation to make the app usable but it is a pretty hopeless solution.  The fullscreen also dies.

any ideas or has anyone found a solution?

Nick

This topic has been closed for replies.

1 reply

Mark.fromOP
Inspiring
July 6, 2013

Try

stage.setAspectRatio(StageAspectRatio.ANY);

see what reults you get.

nukeme2Author
Participant
July 12, 2013

using stage,setAspectRatio or "set" anything, orientation etc,,seems to result in a conflict with whatever the Samsung Galaxy is trying to do so ends up freezing the device. 

Have to confess I haven't tried your StageAspectRatio.ANY so it may work. The reason is that I have found a fix which seems ok without any side effects that I can find so far.  I have no idea what it is all about or why it should work but it does.  You have to modify the xml manifest file with this

<manifest android:installLocation="auto">

  

   <uses-sdk android:targetSdkVersion="11"/>

   <uses-permission android:name="android.permission.INTERNET"/>

  ....

  ....

thanks

Nick

Participant
July 12, 2013

Hi Nick

That's a great discovery. I'm having the same exact problem.

Do you mind telling me whether the XML manifest modifications are to me made before compiling the APK or did you mean modifying the manifest after compiling the APK, i.e. decompile and  then recomple? I tried making the changes in the XML that goes inside the APK package before compiling the APK, but I guess the publish process resets that XML file with default entries, which are:

<manifest><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.READ_PHONE_STATE"/></manifest>

I'd really appreciate if you could mention some more details that helped you overcome this issue, as I'm really stuck with this issue.

Thanks,

Voods