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

Native Development

New Developer
Posts: 2
Registered: ‎07-14-2009
My Device: Not Specified

State of "Rotation lock" checkbox

Is there any way to read the state of the 'Rotation lock' checkbox from the device settings?

Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: State of "Rotation lock" checkbox

Coincidentally I was just thinking along these lines this morning. While I'm pretty sure there's no way to read that setting directly, I think you could infer it from other information, but only once the user actually tries re-orienting the device. You'd have to watch the orientation requests, which in the "locked" case would not arrive, and the device rotation data which should at all times accurately report which way gravity really is. If they're not aligned (and it would involve a bit of non-trivial timing since they're separate data sources) then you'd know the rotation lock was on and could warn the user (if that's what you intended).

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!