title: How to set desired landscape orientation
body: <p>I know you can set orientation using android:screenOrientation statically and setRequestedOrientation programatically.  However the problem is that if I use either of these to set the screen orientation I do not get to choose which landscape or which portrait I want.  To wit, flipping the phone 180 degrees does not rotate the view but rather just appears upside down to the user.  I cannot use screenOrientation="sensor", because in some cases I would only want the view to be landscape OR portrait and seldom both.  This seems insignificant until you consider external hardware.  </p>
  
  <p>If I developed an app and set the layout to android:screenOrientation="landscape", the app would only display correctly if the left side of the droid were sitting on a desk.  Unforunately the left side is where the usb port is, so the phone would not sit very well on that side if it were plugged in.  Unless of course they used a docking station but that is not the kind of help I am looking for.  If the right side of the phone is sitting on the desk to allow for the cord, the display appears upside down. I tried posting an image but being a new user I was not able to do so.</p>
  
  <p>What I would like to know is how to programmatically choose which landscape (Surface.ROTATION_90,Surface.ROTATION_270) or portrait (Surface.ROTATION_0,Surface.ROTATION_180) orientation I wish the user to see, but more importantly allow them to do so in the app's settings activity.  I have googled for quite awhile and all I can find are sensors that tell you when the orientation/rotation has changed and to what, but none show how to programmatically set either. </p>