1

I overided onConfigurationChanged() in android 2.3.3 version. When I changed Land-Scape to Portraint, its orientation is changed but from Portrait to Landscape it is not changing. Please help me to change the orientation from Portrait to Landscape.

public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);

        int orientation = this.getResources().getConfiguration().orientation;

        if (orientation == Configuration.ORIENTATION_PORTRAIT) {
            setContentView(R.layout.settings);
        } else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
            setContentView(R.layout.settings);
        }


    }
Rajesh
  • 449
  • 1
  • 6
  • 13
  • http://stackoverflow.com/questions/9566305/orientation-is-not-working-in-2-3-3 - Related. Seems like an issue only with the emulator http://code.google.com/p/android/issues/detail?id=13189 – Nishant Jun 05 '12 at 07:20

1 Answers1

0

Related Question

Ensure that the Manifest has following entry for the activity you are launching.

  android:configChanges="orientation|keyboardHidden

On the emulator, it might happen that once you change the orientation, it will not go back to the previous one because of this bug

Community
  • 1
  • 1
Nishant
  • 2,975
  • 23
  • 38