我从BaseClass扩展了我的所有活动。因此,我想在BaseActivity类的onCreate()中初始化公共变量。但是,super.onCreate(savedInstanceState);不会立即调用父类的onCreate()方法。为什么?
public class SplashActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // after this line executed, next line executed rather than the onCreate() of parent BaseActivity
...
}
}
public class BaseActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
...
}
}