Which types of flags are used to run an application on Android?
1 Answer
0
There are two types of flags that can be used to execute an application in
Android:
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.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.