Discussion Forums  >  Suggestions, Ideas, Wish List

Replies: 3    Views: 82

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
01/09/14 11:23 AM (11 years ago)

Solved - How to prevent android app rotation?

In BT 2, there was a way of setting android rotation on a specific plugin to be portrait only by editing res/AndroidManifest.xml, where there was an entry for each plugin. All the plugin entries in the manifest file are not located there under BT 3 and I don't know where to look!. Please could anyone suggest where to start? I'll happily post the overall solution if I can piece it together. Thanks, Alan
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
01/10/14 10:03 AM (11 years ago)
Sorry! the bellow code work for Interactive Quiz screen plugin, don't know if it will work for other screens: Open AndroidManifest.xml and look for this: <activity android:name=".BT_screen_quiz" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> Add android:screenOrientation="portrait"to the BT_screen_quiz activity so it looks like this... <activity android:name=".BT_screen_quiz" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:screenOrientation="portrait"></activity> That will prevent the screen from rotating when the quiz is showing.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/10/14 11:36 AM (11 years ago)
Thanks KennedyE. That technique did work for BT 2, but sadly not for BT3, as the individual plugin entries are not in the manifest file any more. Fragments eh! Btw, I can prevent rotation for a whole application, just not for an individual screen! Alan
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/22/14 01:58 PM (11 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.