I need help.
My app still fails when the device orientation changes to landscape.
Whats the problem?
I have set in the Android manifest android:configChanges="keyboardHidden|orientation"
and in the main Activity:
@Override
public void onConfigurationChanged(Configuration newConfig) {
setContentView(R.layout.main);
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
}
}
and my activities are fragments.