android:screenOrientation="portrait" not effects on TabGroup at orientation change

I want only portrait orientation in my app. I have read almost all tutorials regarding AndroidManifest.xml, at the end I added the code android:screenOrientation=”portrait” with all activeties in portion of <application> under <manifest> in tiapp.xml which is working perfect for all other activities i.e splash screen etc. except tabgroup, android:screenOrientation=”portrait” or other screen orientation android:screenOrientation=”landscape” not working on tabs with activity "ti.modules.titanium.ui.TiTabActivity" .I tested app on both emulator and actual device but result is still NO. When I rotate device, tab group also change its orientation even orientation is locked by device setting.
I also checked AndroidManifest.xml by placing it at Resources/platform/android/ with change of android:screenOrientation=”portrait” .My Titanium not loads AndroidManifest.xml form platform folder, every time built new one so I used code in tiapp.xml.
Am I creating mistake at any point on code or its titanium bug.?
.js file code is simple as default titanium created with two tabs.
an my tiapp.xml looks like this..

<android xmlns:android="">
            <application android:icon="@drawable/appicon"
                android:label="Nigerian Stocks" android:name="NigerianStocksApplication"
                <activity android:configChanges="keyboard|keyboardHidden|orientation" android:name=""/>
                <activity android:name=".NigerianStocksActivity"
                    android:label="Nigerian Stocks" android:theme="@style/Theme.Titanium"
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                <activity android:name="org.appcelerator.titanium.TiActivity"
                <activity android:name="org.appcelerator.titanium.TiTranslucentActivity"
                    android:screenOrientation="portrait" />
                <activity android:name="org.appcelerator.titanium.TiModalActivity"
                <activity android:name="ti.modules.titanium.ui.TiTabActivity"
                <activity android:name="" android:screenOrientation="portrait"/>


need help ??
I’m using ..

  1. Mac OS X version: 10.6.8
  2. Titanium SDK Version: 1.7.5
  3. Android Emulator 2.2 …tested other emulators also

8 Answers

  • Change this


    to this


    everywhere in your custom xml where you want to lock the orientation and of course keep the


    Clean the project and try again.
    Try also with fastdev disabled.

  • thanks for replying Dan Tamas!! I have already try this


    still TabGroup is not in control of app..when I perform these changes,clean the build folder and rotate my emulator or device my app turn black and after later shows error The Application abc(process has stopped unexpectedly.Please try again. and App restart.
    fastdev also disabled.

  • try on each window ::

    win.orientationModes = [Ti.UI.PORTRAIT];
  • thanks Gagan Tiwari for reply.I already have tried this on each window.Still Not working.TabGroup not have property orientationModes. and windows are in tabs..

    — answered 4 years ago by Usman Mughal
    • so it is must to do some changes in tiapp.xml………………if u need some code then i can post….

      — commented 4 years ago by Gagan Tiwari
    • Hi Gagan Tiwari.I think code will best source for understanding so share the code..

      — commented 4 years ago by Usman Mughal
  • Hi guy! I'm not getting result of change in activities(android).I reached at point of finding solution of problem "android:screenOrientation="portrait" not effects on TabGroup at orientation change" that adding android:screenOrientation="portrait" in activities only effect on splash screen default by Titanium not effects on any other screen i.e. tabgroup,window etc.Is there any problem in my Titanium?? :(

  • may be late, but I think you had your custom manifest in wrong location

    Resources/platform/android is not where it should be
    platform directory and resources directory should be siblings

  • Step by Step to make this thing works!, already tested!.

  • here's my codeblock from tiapp.xml….

            <orientations device="iphone">
            <orientations device="ipad">