Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>The ActivityC will be removed from task1 and ActivityB becomes to the top Activity. </p> </blockquote> <p>Yes you are Right... </p> <p>ActivityC will be removed from i.e. the onDestroy method of the ActivityC will be called. Hence when the user launches Task 1 again, the ActivityB is shown rather than ActivityC.</p> <p>Have created 2 Tasks (Projects) and uploaded the same @ <a href="http://www.sendspace.com/file/374hfu">SendSpace</a>. Try it out...</p> <p>If you look at androids <a href="http://developer.android.com/guide/topics/manifest/activity-element.html#lmode">documentation</a> it says </p> <p><em>" A "singleTask" activity allows other activities to be part of its task. It's always at the root of its task, but other activities (necessarily "standard" and "singleTop" activities) can be launched into that task."</em></p> <p>Which means that when you click the home button all the activites above the single task activity (which in your case is ActivityB) are removed from the stack.</p> <p>In the sample app's i had given you earlier if you just run the project "AndroidTest" and click the home button in the logs you can see that the 2nd Activity is put on Pause, and when you launch it again from the "Recent App's" list the 2nd Activity is Destroyed.</p> <p>In a senario where the Activity's above the Single Instance activites (ActivityB) are not removed from the Back Stack, and another application request this Activity (ActivityB) it may not be shown and the intent may be dropped. But this has extreamly less chances of happening because the user will have to press the Home button and but the current Task\App in the BackStack before he could navigate to another Task\App.</p> <p>Hence the warning </p> <p><em><strong>The other modes — singleTask and singleInstance — are not appropriate for most applications, since they result in an interaction model that is likely to be unfamiliar to users and is very different from most other applications.</em></strong></p> <p>I hope this solves your doubts.</p>
 

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