今天在项目中接触到了这么一个关键字,记录下来以备以后查看。
首先来看代码:
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
it.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
intent的源码,官方的解释如下:
/**
* If set, and the activity being launched is already running in the
* current task,