Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the <a href="http://developer.android.com/guide/topics/fundamentals.html#lmodes" rel="noreferrer">Application Fundamentals</a> page of the Android dev guide:</p> <blockquote> <p>By default, all the activities in an application have an affinity for each other — that is, there's a preference for them all to belong to the same task.</p> <p>A "singleInstance" activity stands alone as the only activity in its task. If it starts another activity, that activity will be launched into a different task regardless of its launch mode — as if FLAG_ACTIVITY_NEW_TASK was in the intent. In all other respects, the "singleInstance" mode is identical to "singleTask".</p> <p>As noted above, there's never more than one instance of a "singleTask" or "singleInstance" activity, so that instance is expected to handle all new intents. A "singleInstance" activity is always at the top of the stack (since it is the only activity in the task), so it is always in position to handle the intent. However, a "singleTask" activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.)</p> </blockquote> <p><img src="https://i.imgur.com/l7vfI.png" alt="4 Activities in a Task"></p> <p>Since there is never more than one instance of the Activity with either launch mode, the back button will always take you to the existing instance of the Activity in your case.</p> <p>An important difference is that "singleTask" doesn't require the creation of a new task for the new Activities being launched when something is selected. Nor will it have to remove that new task on the back button each time. </p> <p>Since your Activity stack does all pertain to one user "task", and it doesn't sound like you have an intricate Intent structure where singleInstance may be beneficial to always handle them, I would suggest using the singleTask launch mode.</p> <p>Here is a good blog post for more info, as well as credited for the image: <a href="http://blog.akquinet.de/2010/02/17/android-activites-and-tasks-series-an-introduction-to-androids-ui-component-model/" rel="noreferrer">Android Activities and Tasks series – An introduction to Android’s UI component model</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload