How to handle screen orientation without rotating screen?
I have override onConfigurationChanged in my activity and try to comment out call super.onConfigurationChanged and my application Force Closes. Next thing I’ve tried was to set orientation attribute in newConfig parameter of this method to newConfig.orientation = Configuration.ORIENTATION_PORTRAIT; before call super.onConfigurationChanged. But still my screen has rotated.
My last implementation would be to handle sensor (gyroscope) movement. But is there any other way to do this?
Any other ideas?
In your manifest file, add this to your activity which you don’t want to rotate:
This will prevent it from ever rotating, including if the phone has a slide out keyboard.
I hope this helps.