public abstract void startActivities(Intent [] intents)
我一直在Googling试图通过在应用程序代码,问题或文章中使用的例子来展现我的好奇心,但是至今还没有遇到任何问题.如果有人问过类似的问题,请通知我.
无论如何,我很好奇应该在应用程序代码中使用什么,什么(如果有的话)这样做的好处是什么?我个人从未看过这种方法,我无法掌握它的实用性.任何反馈将不胜感激.
解决方法
但是,当启动新的任务时,它可以用于创建一个合成的后备栈.您想要有一个现成的后备堆栈,以便后面的密钥在此任务内“分层”导航.
奇怪的是,在documentation of ContextCompat
中比在Context本身更好地解释.
Start a set of activities as a synthesized task stack,if able.
In API level 11 (Android 3.0/Honeycomb) the recommended conventions
for app navigation using the back key changed. The back key’s behavior
is local to the current task and does not capture navigation across
different tasks. Navigating across tasks and easily reaching the
prevIoUs task is accomplished through the “recents” UI,accessible
through the software-provided Recents key on the navigation or system
bar. On devices with the older hardware button configuration the
recents UI can be accessed with a long press on the Home key.When crossing from one task stack to another post-Android 3.0,the
application should synthesize a back stack/history for the new task so
that the user may navigate out of the new task and back to the
Launcher by repeated presses of the back key. Back key presses should
not navigate across task stacks.startActivities provides a mechanism for constructing a synthetic task stack of multiple activities. If the underlying API is not available on the system this method will return false.