Created
October 28, 2018 13:36
-
-
Save diaolizhi/2ba31b780ee45fa392b90428846e7c12 to your computer and use it in GitHub Desktop.
Android 跳转到一个 Activity 前清空 Activity 栈
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btnFinish.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intentToFinish = new Intent(WizardThree.this, FinishActivity.class); | |
//重点是下面这一句 | |
intentToFinish.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); | |
intentToFinish.putExtra("setting", setting); | |
startActivity(intentToFinish); | |
WizardThree.this.finish(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment