2

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.

gkiar
  • 480
  • 1
  • 6
  • 20
Keyur Android
  • 375
  • 2
  • 6
  • 20

3 Answers3

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?

Community
  • 1
  • 1
Ron
  • 24,175
  • 8
  • 56
  • 97