How to prevent the display of all activity screens in android

I have my app with about 15 actions. Now I know one way to prevent activity from spinning, i.e. Overriding the onConfigurationChanged () method and defining it in xml.

Since I have about 15-20 operations redefining each of them, I do not think this is the best practice. So, is there any other way to do this.

+3
source share
4 answers

You can add this to your manifest:

android:screenOrientation="portrait"

for every action you want to limit. Also works for "landscape".

+3
source

. activity , . :

. , , . , , , Google Play, , , . , "", "reverseLandscape" "sensorLandscape", , . , , <uses-feature>. , <uses-feature android:name="android.hardware.screen.portrait"/>. , Google Play ( , ), , .

, . , , activity:

<uses-feature android:name="android.hardware.screen.portrait"/>
+3

@Stuart ​​ .

, , , Android Activity onCreate(). , Android .

+2

Add this to your manifest:

  <activity  android:screenOrientation="portrait"></activity>
0
source

All Articles