How to make the scene (program) always remain in portrait mode? In the manifest, I registered, but it works only for the settings screen. Also indicated:

config.useGyroscope = false; config.useAccelerometer = false; 

and

 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 

Still turns when tilting.

UPD. It did not work because of the third-party launcher. In the standard, everything works without problems .. My carelessness ..

    2 answers 2

    In the manifest at the level for each activity install android:screenOrientation="portrait"

    • Installed, did not help. - Rusl Mag
    • updated. Did you install it like this? - pavel163
    • I can be mistaken, but there are two landscape orientations, and the question asks not only how to restrict to landscape ones, but also how to prohibit coups. - Qwertiy
    • Yes, it is also spelled out. - Rusl Mag
    • android: screenOrientation = "portrait" with this config you will not have any coups - pavel163

    Register in AndroidManifest.xml for each activity the following lines:

     android:configChanges="orientation" android:screenOrientation="portrait" 

    The android:configChanges="orientation" attribute indicates that activity should follow the orientation also during operation. Here you can transfer not only the orientation of the screen, but also the keyboard, etc.

    Read more in the documentation.