yllaw
Posts: 0
Joined: Fri Apr 27, 2012 7:44 am

how disabling auto rotate screen thru code?

Hi

I like to ask if is there a way that I can disable auto rotate screen thru code?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how disabling auto rotate screen thru code?

Unfortunately there is no simple way to do it, plus iOS and Android work differently. Here is more information:

http://stackoverflow.com/questions/60...
http://code.google.com/p/chromium/iss...

Some people are doing it via PhoneGap:
http://stackoverflow.com/questions/74...

You could also try listening to orientationchange event:
http://stackoverflow.com/questions/52...

I didn't find a universal solution that would work for both iOS and Android.

yllaw
Posts: 0
Joined: Fri Apr 27, 2012 7:44 am

how disabling auto rotate screen thru code?

Thanks Max for the response, anyway I let it check all your given links.

marieall
Posts: 0
Joined: Thu Oct 03, 2013 4:10 pm

how disabling auto rotate screen thru code?

Hi Max, since the post is 1 year old, I am wondering if there is any easier way now to lock the screen rotation of my app, or at the very least of one page of my app, without exporting the projecting to Eclipse ? (whatever is easier)

I don't know anything about eclipse and when I tried, to open my project in Eclipse, it opened with error and i can't create an apk from it. (Plus I don't know where and to amend the androidmanifest.xml file... )

thanks for your help in advance :)

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

how disabling auto rotate screen thru code?

Please check https://getsatisfaction.com/apperyio/...
You don't need to export app to Eclipse, it can be done through Appery.io builder on Source tab.

marieall
Posts: 0
Joined: Thu Oct 03, 2013 4:10 pm

how disabling auto rotate screen thru code?

that's a big relief for me!!
So i juste need to put android:screenOrientation="portrait" in each activity on the androidmanifest file? that's it? or in a specific activity?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

how disabling auto rotate screen thru code?

Yes:)
Just checked again. Looks like there is no way to lock orientation for a specific screen, but you can do that for entire app.

marieall
Posts: 0
Joined: Thu Oct 03, 2013 4:10 pm

how disabling auto rotate screen thru code?

I just amended all activity with the code line, but now i have this message when i try to build the apk: Build error

Would you be OK to help me check what I've done wrong on the file? Can I send you the content of the file ?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

how disabling auto rotate screen thru code?

Please send us this file to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Return to “Issues”