解决方案:
1、在AndroidMenifest.xml中,在当前Activity中加入android:configChanges="orientation|keyboardHidden|screenSize"
2、activity中
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Log.i("test", "onConfigurationChanged");
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
Log.i("test", "onConfigurationChanged_ORIENTATION_LANDSCAPE");
} else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
Log.i("test", "onConfigurationChanged_ORIENTATION_PORTRAIT");
}
}
1072




被折叠的 条评论
为什么被折叠?



