Well, a lot depends on how you have set taskAffinity
for the various activities in the manifest.
Let's assume that you configured it so that activity A
and activity B
have different taskAffinity
(which is the way you SHOULD configure it). When you start your app, Android creates a new task containing A
. When you launch B
from A
, Android should create another new task containing only B
. The task containing A
is sent to the background. You should now have 2 tasks, one contains only A
and one contains only B
. When you launch C
from B
, the second task should now contain B->C
. When you press the HOME button, the second task is sent to the background.
Now, when you look in the list of recent tasks, you should actually see 2 tasks for your app. Depending on which one you choose, you will get either the task containing only A
, or the task containing B->C
.
This is why you should NOT use special launch modes singleTask
or singleInstance
, because they do a lot of stuff that you don't expect. If you ignore this advice and use these launch modes anyway, you must be aware how taskAffinity
impacts the way activities are launched into the various tasks, and you also need to be aware that you may end up with multiple tasks, in which case you need to provide a way for the user to return to the correct task from the list of recent tasks. This also means that you may need to provide different labels for the tasks and/or differnt icons for the tasks, in order to help the user find the correct task to resume.