Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Orientation change bug

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.

like image 321
Adam Varhegyi Avatar asked Mar 15 '26 12:03

Adam Varhegyi


1 Answers

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.

like image 71
Ovidiu Latcu Avatar answered Mar 17 '26 02:03

Ovidiu Latcu