Skip to main content
Participant
January 9, 2012
Question

Screen Orientation in Ice Cream Sandwich?

  • January 9, 2012
  • 3 replies
  • 1418 views

Hello,

First time posting here.  I've got an app that I run in just landscape mode.  I force landscape mode by doing the following in the app.xml file:

    

     <initialWindow>

         <autoOrients>false</autoOrients>

        <fullScreen>false</fullScreen>

        <visible>true</visible>

        <aspectRatio>landscape</aspectRatio>

        <softKeyboardBehavior>none</softKeyboardBehavior>

    </initialWindow>

This has been working perfectly.  However, I recently got a Galaxy Nexus (with ICS) and when I run the app on there, if I lock the screen with the app open, when I unlock it, the screen is in portrait and I cannot change it back to landscape without restarting the app.  I tried doing stage.SetOrientation when the screen is activated again to see if that would be a fix, but this causes the phone to completely freeze when I attempt to unlock it.  The app works as expected on other phones, so I'm guessing this is an ICS issue.  Anybody know a workaround?

I appreciate any help. I've spent quite a few hours and time searching for an answer to this, but haven't had any luck.  Thanks!

This topic has been closed for replies.

3 replies

January 10, 2012

I am having the same problem with one of my apps. Check out this post http://forums.adobe.com/thread/944805?tstart=0 Colin posted a piece of code in that post that worked for me in a separate issue but I believe this will solve the problem.

dcrickAuthor
Participant
January 10, 2012

Mark.Raykhenberg wrote:

I am having the same problem with one of my apps. Check out this post http://forums.adobe.com/thread/944805?tstart=0 Colin posted a piece of code in that post that worked for me in a separate issue but I believe this will solve the problem.

This didn't work.  The app freezes when the activate function is called.  When I try running in debug, it seems the screen orientation is changed to portrait when the lock screen comes up (I guess since the lock screen is in portrait mode, but it isn't an issue on non-ICS devices).  It seems that activate is called when the lock screen is brought up (as opposed to when the phone is successfully unlocked).  I'm guessing it freezes because it is trying to set the orientation back to landscape but the lock screen is continuously forcing it to portrait.  Is there a way to detect when the phone has been unlocked and to change the orientation then?

Participant
June 7, 2012

Same problem here with a Samsung Galaxy S2 with ICS. Setting the orientation after Event.ACTIVATE freeze the application. Anyone have any suggestions?