Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
gluth
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Listen for rotation - problem with vertical centering

I observed that stage.deviceOrientation always return unknown, but stage.orientation (which is deprecated) is always right. Maybe this is fixed or will be fixed before launch.

 

One additional thing, code in this example will not work, when you rotate device with minimized application. You should check current state on activation event (guessing here).

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Listen for rotation - problem with vertical centering

Jakub, good call on that.  I just checked with debug mode and do not see any trace() calls in the event handler when I rotate while the app is minimized.

 

I also confirmed your not about stage.deviceOrientation returning "unknown", while stage.orientation does appear to be correct, though deprecated.

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
gluth
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: Listen for rotation - problem with vertical centering

When app is minimized deviceOrientation or orientation are not updated. You may have rotated application which is described as "default" in one of these fields.

 

Workaround to check orientation after activation is useless for now. Does anybody have better workaround? This looks like a bug in orientation system.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
--
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Listen for rotation - problem with vertical centering

I agree that must be a bug.  For now then, the workaround would be manual: change orientation twice to get your app back to the proper state.

 

I'd file it as a bug report, but it's still unclear whether there's any value in doing that.  (I mean, we've seen probably a dozen or more new bugs, but filing all of them properly would take me a day and my time seems to be better spent analyzing them and discussing here.  QNX folks, please feel free to improve the process by which you deal with bug reports, to fix that.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!