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.
You can add this to your manifest:
android:screenOrientation="portrait"
for every action you want to limit. Also works for "landscape".
. activity , . :
activity
. , , . , , , Google Play, , , . , "", "reverseLandscape" "sensorLandscape", , . , , <uses-feature>. , <uses-feature android:name="android.hardware.screen.portrait"/>. , Google Play ( , ), , .
<uses-feature>
<uses-feature android:name="android.hardware.screen.portrait"/>
, . , , activity:
@Stuart .
, , , Android Activity onCreate(). , Android .
Activity
onCreate()
Add this to your manifest:
<activity android:screenOrientation="portrait"></activity>