I need to handle device rotation in my app. At the same time, I need to have the app in landscape mode. If in the manifest file I've:
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"
the onConfigurationChanged method is never called.
How to handle this ?
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Checks the orientation of the screen
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
viewRotate.setVisibility(View.GONE);
viewControl.setVisibility(View.VISIBLE);
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
viewControl.setVisibility(View.GONE);
viewRotate.setVisibility(View.VISIBLE);
}
}