I have an application that I just would like to use in portrait mode, so I have defined android:screenOrientation=\"portrait\" in the manifest XML. This works OK for the HTC
Please note, none of the methods seems to work now!
In Android Studio 1 one simple way is to add android:screenOrientation="nosensor".
android:screenOrientation="nosensor"
This effectively locks the screen orientation.