Here I am developing an application which plays video in only landscape mode. I set my activity orientation to "landscape" in AndroidManifest.xml file, and my video is playing very nice but problem is that I hold my device in Landscape mode, when I rotate my device to 180 angle my video playing is upside down (bottom to top). It is not chaging according to that.
Asked
Active
Viewed 3,423 times
2
-
is there any doubt in question to understand ? did i write ant thing wrong. – Keyur Android Jun 26 '12 at 13:20
-
please add the min sdk version to ur post – Ron Jun 26 '12 at 13:57
-
my min sdk version is "8" and my tetig device is KindleFire Tablet – Keyur Android Jun 27 '12 at 05:16
3 Answers
5
If you are targeting android version 2.3 or greater then use following in onCreate
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

Vipul
- 27,808
- 7
- 60
- 75
1
you can do from manifest file like this:
<activity android:name=".Video" android:screenOrientation="userLandscape">

Shivam Bhusri
- 1,111
- 9
- 12
0
If you are developing for android 2.2 and below you will have to rotate your content view canvas. Here are two similar questions that suggest something like that..
How to display Android UI Elements about 180 degrees rotated
How can you display upside down text with a textview in Android?