There are two types of flags that can be used to execute an application in
FLAG ACTIVITY NEW TASK
FLAG ACTIVITY CLEAR TOP
On Android, activities are launched using intents. You can control the task that will contain the activity by setting flags. There are flags for creating new activities, using existing activities, and bringing an existing instance of an activity to the front.
FLAG ACTIVITY NEW TASK is one of the flags that can be used to change the default behaviour. In a new task, begin the action. If a task for the activity you're initiating is already running, it's brought to the foreground with its previous state restored, and the activity gets the new intent in onNewIntent().
FLAG ACTIVITY CLEAR TOP: If the Activity being started is already running in the current task, all other activities on top of it are terminated (with a call to the onDestroy function) and this intent is provided to the restarted instance of the Activity.