android跳转登录界面,一般来说登陆界面是在登录的时候就已经销毁掉的,此时需要回到登录界面需要移除现有的所有activity,并且需要重新创建新的登录界面,这时候,可以在intent中增加Flag(FLAG_ACTIVITY_CLEAR_TASK),可以清除现存在此Task中的所有activity,再增加Falg(FLAG_ACTIVITY_NEW_TASK)
Intent intent = new Intent(SettingActivity.this, LoginActivity.class);
//intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("isLogin",false);
SettingActivity.this.startActivity(intent);
SettingActivity.this.finish();