I want to make my android application fixed oriented, where no one can change the app’s orientation by any kind of force. So far I used these in my manifest’s activity tag:
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden"
it’s working fine in my emulator, but in real device when I press the orientation change button it’s orientation is changing and getting a force close. What should I do next?
If you define android:configChanges=”orientation|keyboardHidden”
in your manifest then the activity won’t restart but instead onConfigurationChanged will be called.
So override onConfigurationChanged method in your java file.