1. 程式人生 > >[Android]關閉所有Activity 然後開啟某個Activity

[Android]關閉所有Activity 然後開啟某個Activity

private volatile long lastJump = 0; public void loginAgain(String message){ if(System.currentTimeMillis() - lastJump > 2000) { lastJump = System.currentTimeMillis(); Intent intent = new Intent(this, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); Bundle bundle = new
Bundle(); bundle.putBoolean(Constant.INTENT_LOGIN_AGAIN,true); bundle.putString(Constant.INTENT_LOGIN_MESSAGE,message); intent.putExtras(bundle); startActivity(intent); } }