How to distinguish between Landscape (Right/Left) vs Portrait (Up/Down) on android? I tried:
getResources().getConfiguration().orientation
and it always returns Configuration.ORIENTATION_PORTRAIT.
also, I checked:
Check orientation on Android phone
I tried the onConfigurationChanged as well. I cannot get Right vs Left on landscape mode (up vs down on portrait).
Is there a clean way of finding this on Android 5.0+?
Note: My activity could be launched with any orientation. Capturing orientation changes using a listener may not be viable since I want the real orientation of the phone (even before I get a callback on orientation changes).
Also, by default:
android:screenOrientation="portrait"
Note: My activity responds to auto-rotate changes.