public static final int FLAG_ACTIVITY_NEW_TASK
If set, this activity will become the start of a new task on this history stack.
A task (from the activity that started it to the next task activity) defines an
atomic group of activities that the user can move to. Tasks can be moved to the
foreground and background; all of the activities inside of a particular task
always remain in the same order. See the Application Model documentation for
more details on tasks.
This flag is generally used by activities that want to present a "launcher" style
behavior: they give the user a list of separate things that can be done, which
otherwise run completely independently of the activity launching them.
When using this flag, if a task is already running for the activity you are now
starting, then a new activity will not be started; instead, the current task will
simply be brought to the front of the screen with the state it was last in. See
FLAG_ACTIVITY_MULTIPLE_TASK for a flag to disable this behavior.
This flag can not be used when the caller is requesting a result from the activity being launched.
Constant Value: 268435456 (0x10000000)
public static final int FLAG_ACTIVITY_BROUGHT_TO_FRONT
This flag is not normally set by application code, but set for
you by the system as described in the launchMode documentation for the singleTask mode.
Constant Value: 4194304 (0x00400000)
public static final int FLAG_ACTIVITY_CLEAR_TOP
If set, and the activity being launched is already running in
the current task, then instead of launching a new instance of
that activity, all of the othe
Intent FLAG详解
最新推荐文章于 2024-04-21 21:38:07 发布
本文详细解析了Android中Intent的多个FLAG常量,包括FLAG_ACTIVITY_NEW_TASK、FLAG_ACTIVITY_BROUGHT_TO_FRONT、FLAG_ACTIVITY_CLEAR_TOP等,这些FLAG用于控制活动(Activity)的行为,如启动新任务、清除堆栈顶部的活动、排除最近使用列表等,对于理解和控制应用程序的行为至关重要。
摘要由CSDN通过智能技术生成