3

I use setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); in my activites.

My application turns to landscape mode just for a very short duration like about 0.2 seconds if i change betwen activities. After the ladnscape change it is changes back to portrait but it is very annoying bug.

Why is it happening ? Is there a better way to restrict the application to only use PORTRAIT orientation?

I dont want the 0.2 sec flashy orientation change.

Stefan
  • 4,997
  • 8
  • 26
  • 51
Adam Varhegyi
  • 12,015
  • 32
  • 115
  • 205
  • 1
    Did you try android:configChanges="orientation" in your activity declaration in manifest? – ania Jul 09 '12 at 13:12
  • 1
    android:screenOrientation="portrait" for all activites in manifest. – sanna Jul 09 '12 at 13:14
  • 1
    You should look at this question. Seems like the same problem: http://stackoverflow.com/questions/4885620/force-portrait-orientation-mode – ania Jul 09 '12 at 13:25

1 Answers1

3

If you want your Activities to be in portrait all the time, you should specify the android:screenOrientation:"portrait" xml tag in your AndroidManifest.xml for each <activity> tag.

Ovidiu Latcu
  • 70,421
  • 14
  • 74
  • 84