Every time I turn my phone landscape mode, my activity resets. How do I stop the activity from resetting?
Here's the code I tried using but it does not work.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
setContentView(R.layout.get_msg);
} else {
setContentView(R.layout.get_msg);
}
}
manifest file:
android:configChanges="orientation|keyboardHidden|screenSize"
Here is the link where I got it from: