Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, now that you answered that comment I can answer your question feeling more safe about it.</p> <p>What kabuko said is right. However, you're not understanding it because you don't even understand the concept of tasks, and how that relates to the launcher.</p> <p>When you have a <code>singleInstance</code> activity being started at the launcher (see? that's why I asked about your manifest!), the launcher is <strong>not</strong> launching/restarting whatever activities you started/used with Activity A (a <code>singleInstance</code> activity). It's starting/restarting the A's <strong>task</strong> as it was left.</p> <p>In fact, as the documentation says (read kabuko's answer), when you launch B from A, B is considered a new task altogether. It just happens that those two activities are "glued" together in the activity history... obviously, since you start B right after starting A. But I say again: <strong>it's important to see that this constitutes a logical break into your application.</strong></p> <p>And why is that a logical break, you ask?</p> <p>Because A is a <code>singleInstance</code> activity. And as already said here, those are the one and only one activity in that task. So, if you start that <strong>task</strong> again from the launcher, you will end up at A again, and not B since B is another task that does not belong to A.</p> <p>Compare to what you were expecting: if A were a <code>standard</code>, B would be started and considered in the same task. Therefore, restarting A's <strong>task</strong> would end up in B, which is what you were expecting.</p> <p>Finally, as the doc says, this is the reason why you mostly always should not use <code>singleTask</code> and even less <code>singleInstance</code>. Those are not the expected behavior. And since they are not for you, they will be even less for the user, everything else equal.</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. 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.
 

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