Search code examples
androidrotationandroid-manifestautorotate

Android Activity not rotating to all sides?


I have a activity that I want to rotate. I use the following in my AndroidManifest.xml:

    <activity
        android:name=".MorburActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:screenOrientation="sensor">

        <intent-filter>
            <action
                android:name="android.intent.action.MAIN" />
            <category
                android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

So, I say that the screen orientation should change when the device is rotated. No I see the problem. When I use my device in normal position (portrait with buttons on the bottom), it works fine. Also rotating the device to the right, it works fine. The activity is recreated and everything is displayed with a different layout made for landscape.

All good until here. But now comes the problem. When I rotate the device to the left of have it upside down, it doesn't do anything. The activity is not recreated and not displayed correctly.

Can this be a problem with my phone? I use a Samsung Galaxy 5 Europe. Or have I made a programming error? I can't test this in the emulator. It has only the two states that are working for me.


Solution

  • my Motorola DEFY has only 3 rotations, I have test it in android default web browser, on the vertical position it has only one and on horizontal it has both rotations.. even though I don't think that the activities have all 3 rotations, I think they have only vertical and horizontal rotations, one for both..