Android orientation on tab group does not work.

You must Login before you can answer or comment on any questions.

Hello,

i hope someone could help me with this issue, i've read every single info on the subject everywhere i just cant get it to work.

i have four tabs with views in them, i just want to lock them to portrait mode? is this really that complicated?

i have even tried the custom manifest file solution.

thanks in advance.

Regards

— asked 7 months ago by AlinuX .
0 Comments

3 Answers

Accepted Answer

How did u try the custom android manifest? Have you cleaned the project ?

— answered 7 months ago by Dan Tamas
answer permalink
4 Comments
  • i have created a projectname/platform/android folder and copied the manifest file from the build directory. then i modified it like this

    <?xml version="1.0" ?><manifest android:versionCode="4" android:versionName="1.2" package="com.myapp.myapp" xmlns:android="http://schemas.android.com/apk/res/android">
        <uses-sdk android:minSdkVersion="8"/>
     
        <!-- TI_MANIFEST -->
     
        <application android:debuggable="false" android:icon="@drawable/appicon" android:label="myapp" android:name="MyApplication">
     
            <!-- TI_APPLICATION -->
     
            <activity android:configChanges="keyboardHidden|orientation" android:label="myapp" android:name=".myappActivity" android:theme="@style/Theme.Titanium">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
     
            <activity android:configChanges="keyboardHidden|orientation" android:launchMode="singleTask" android:name="ti.modules.titanium.media.TiVideoActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
     
            <activity android:configChanges="keyboardHidden" android:name="org.appcelerator.titanium.TiActivity"  android:screenOrientation="portrait"/>
            <activity android:configChanges="keyboardHidden|orientation" android:name="org.appcelerator.titanium.TiTranslucentActivity" android:theme="@android:style/Theme.Translucent"/>
            <activity android:configChanges="keyboardHidden|orientation" android:name="org.appcelerator.titanium.TiModalActivity" android:theme="@android:style/Theme.Translucent"/>
            <activity android:configChanges="keyboardHidden" android:name="ti.modules.titanium.ui.TiTabActivity" android:screenOrientation="portrait"/>
            <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/>
     
            <service android:exported="false" android:name="org.appcelerator.titanium.analytics.TiAnalyticsService"/>
     
     
        </application>
     
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.INTERNET"/>
     
     
    </manifest>

    — commented 7 months ago by AlinuX .

  • how should it be?

    — commented 7 months ago by AlinuX .

  • You need to add the android:screenOrientation=&quot;portrait&quot; in all the activities. Right now you have it only in 4 of them.

    also try tot change android:configChanges=&quot;keyboardHidden|orientation&quot; to android:configChanges=&quot;keyboardHidden&quot; everywhere.

    — commented 7 months ago by Dan Tamas

  • Show 1 more comment

You missed the main activity :)

— answered 7 months ago by Dan Tamas
answer permalink
2 Comments
  • are you there ?

    — commented 7 months ago by AlinuX .

  • yeah, but don't know what to say, and no time to test it myself.

    — commented 7 months ago by Dan Tamas

any one who can help ?

— answered 7 months ago by AlinuX .
answer permalink
5 Comments
  • thanks everyone, i figured it out at last :)

    — commented 7 months ago by AlinuX .

  • What did u do?

    — commented 7 months ago by Dan Tamas

  • i just edited the line for "ti.modules.titanium.ui.TiTabActivity" and added the android:screenOrientation="portrait" tag , removed the orientation word from "keyboardHidden|orientation" and left everything else as is.

    — commented 7 months ago by AlinuX .

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!