How to block application for switching to landscape mode
| Thu, 2008-05-15 17:13 | |
|
Hi, I have a little problem with my application on Nokia E66. Nokia E66 has buildin sensor to detect phone's position. When the phone is rotated and set in horizontal position it automatically switches to the landscape mode. My application is then rotated instead of remaining in the portrait mode. Another problem is when I am starting my application in the landscape mode, it is scaled instead of starting in the portrait mode. Is there same way to force application to start and stay always in the portrait mode? Thanks in advise. |
|






Forum posts: 4
I have already tried this:
BaseConstructl(EAppOrientationPortrait);
in my UI ConstructL method, but it didn't help.
It is a little tricky problem, when I am getting orientation using Orientation() method from CAknAppUiBase it always returns portrait (for both: landscape and portrait screen orientations). When switching between portrait/landscape I am getting event EEventScreenDeviceChanged and CurrentScreenMode() from CWsScreenDevice returns 1 when phone's screen is in landscape and 0 when phone's screen is in portrait. I have illustrated my problems in the attached document.
Forum posts: 1134
To me it sounds like there might be some bug in the E66, and how it handles layoutchanges with the sensor...
BaseConstructL(EAppOrientationPortrait) is indeed what should "block" your application from lanscape mode.
I just added that to one of our demo apps on the N95, and that worked fine...
N95 doesn't switch by sensor though, but if you slide it to "mediaplayer mode"
Don't have an E66 to test in on unfortunately.
Have you posted about it on forum nokia too?
Forum posts: 152
No he hasn't... but already posted to the Symbian forums
http://developer.symbian.com/forum/thread.jspa?threadID=25487