I just want to propose another alternative that will concern some of you :
android:configChanges="orientation|keyboardHidden"
implies that we explicitly declare the layout to be injected.
In case we want to keep the automatic injection thanks to the layout-land and layout folders. All you have to do is add it to the onCreate:
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
getSupportActionBar().hide();
} else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
getSupportActionBar().show();
}
Here, we display or not the actionbar depending on the orientation of the phone