Activity中
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null && savedInstanceState.getBoolean(Constant.ACCOUNT_REMOVED, false)) {
// 防止被移除后,没点确定按钮然后按了home键,长期在后台又进app导致的crash
// 三个fragment里加的判断同理
DemoHelper.getInstance().logout(true,null);
finish();
startActivity(new Intent(this, LoginActivity.class));
return;
} else if (savedInstanceState != null && savedInstanceState.getBoolean("isConflict", false)) {
// 防止被T后,没点确定按钮然后按了home键,长期在后台又进app导致的crash
// 三个fragment里加的判断同理
finish();
startActivity(new Intent(this, LoginActivity.class));
return;
}
setContentView(R.layout.em_activity_main);
initView();
}
@Override
protected void onSaveInstanceState(Bundle outState) {//保存Activity的附件信息
outState.putBoolean("isConflict", isConflict);
outState.putBoolean(Constant.ACCOUNT_REMOVED, isCurrentAccountRemoved);
super.onSaveInstanceState(outState);
}