My Android device can rotate in all orientations (0, 90, 180, 270). How do I disable upside down (180 degree) only? Is that possible?
Asked
Active
Viewed 906 times
1
-
You can check [this](https://stackoverflow.com/questions/3611457/android-temporarily-disable-orientation-changes-in-an-activity) answer, This might have help you. – Flutterian Nov 21 '17 at 02:36
-
@androidOnHigh thanks you so much but this is different issue – pes Nov 21 '17 at 02:45
-
@android_Muncher I learned forums but didn't find solution in this case – pes Nov 21 '17 at 02:50
1 Answers
0
You just have to define the property below inside the activity element in your AndroidManifest.xml file. It will restrict your orientation to portrait.
<activity
android:name="com.example.demo_spinner.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>

Kushal
- 31
- 3