I have created an activity which has two layout define one in layout-port
and another in layout-land
. They work fine so far.
but the problem is I dont want that onCreate
gets called again when the orientation gets changed. so to prevent that I have specified android:configChanges="orientation"
attribute in Manifest file and use the following code in activity
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
now when I run the application and change the orientation on a real device I can see android is only using portrait layout even I tilt the device and not changing the activity state.
so basically onCreate
is not getting called which I want but the device is not using landscape mode when the device gets tilted.