android - How to set desired landscape orientation -


i know can set orientation using android:screenorientation statically , setrequestedorientation programatically. problem if use either of these set screen orientation not choose landscape or portrait want. wit, flipping phone 180 degrees not rotate view rather appears upside down user. cannot use screenorientation="sensor", because in cases want view landscape or portrait , seldom both. seems insignificant until consider external hardware.

if developed app , set layout android:screenorientation="landscape", app display correctly if left side of droid sitting on desk. unforunately left side usb port is, phone not sit on side if plugged in. unless of course used docking station not kind of looking for. if right side of phone sitting on desk allow cord, display appears upside down. tried posting image being new user not able so.

what know how programmatically choose landscape (surface.rotation_90,surface.rotation_270) or portrait (surface.rotation_0,surface.rotation_180) orientation wish user see, more importantly allow them in app's settings activity. have googled quite awhile , can find sensors tell when orientation/rotation has changed , what, none show how programmatically set either.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -