锤子T2真机测试
设置手机为自动旋转屏幕
不设置Activity的android:configChanges
切横屏:
切竖屏:
不设置-切竖屏.png设置Activity的android:configChanges="orientation"时
切横屏:
设置-切横屏.png切竖屏:
设置-切竖屏.png设置Activity的android:configChanges="orientation|keyboardHidden"时
切横屏:
切横屏.png切竖屏:
切竖屏.png为什么和网上搜索到的大部分答案都不一样呢?谁知道,请告知!!!
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("TAG", "onCreate");
setContentView(R.layout.activity_main);
}
@Override
protected void onStart() {
Log.d("TAG", "onStart");
super.onStart();
}
@Override
protected void onResume() {
Log.d("TAG", "onResume");
super.onResume();
}
@Override
protected void onPause() {
Log.d("TAG", "onPause");
super.onPause();
}
@Override
protected void onStop() {
Log.d("TAG", "onStop");
super.onStop();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
Log.d("TAG", "onSaveInstanceState");
//super.onSaveInstanceState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
Log.d("TAG", "onRestoreInstanceState");
//super.onRestoreInstanceState(savedInstanceState);
}
@Override
protected void onRestart() {
Log.d("TAG", "onRestart");
super.onRestart();
}
@Override
protected void onDestroy() {
Log.d("TAG", "onDestroy");
super.onDestroy();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
Log.d("TAG", "onConfigurationChanged");
super.onConfigurationChanged(newConfig);
}
网友评论