@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_sensors);
Log.d(TAG, "onCreate()2 called with: savedInstanceState = [" + savedInstanceState + "]");
Intent intent = getIntent();
String address = intent.getStringExtra(ADDRESS_KEY);
....
}
04-22 16:51:55.553 7595-7595 / my.app D / SensorsActivity:onCreate()调用:savedInstanceState = [null] 04-22 16:51:56.053 7595-7595 / my.app D / SensorsActivity:onCreate()2调用:savedInstanceState = [null]
onCreate()和onCreate()2之间的时间是500毫秒,并在应用程序中显示... 任何人都可以暗示为什么会这样? 非常感谢!