I have an activity in which there is a spinner. because for portrait and landscape mode I have a different layout, so I change the layout in the methodonConfigurationChanged
@Override
public void onConfigurationChanged(Configuration conf) {
super.onConfigurationChanged(conf);
setContentView(R.layout.layout);
initUI();
}
but the problem is that when I change the orientation, my counter is recreated, so if the spinner is open in portrait mode, it approaches in landscape mode. My requirement is: if it is open in any mode, it must be open after changing orientation. can you tell me how to handle this situation.
source
share