Android backstack with tasks and activities from different apps

118 Views Asked by At

I seem to find conflicting information with regards to the basic/default behavior of the backstack when dealing with tasks whose activities come from different apps. From my understanding so far:

  • A task is a collection of activities where those activities could be entirely from 1 app or from a mix of multiple apps. Essentially (if I am understanding this correctly), a task is a "path/sequence of instantiated activities" -- regardless of what app these activities belong to.
  • Each task has its own backstack of activities that maintains the order of these instantiated activities with the most recent activity on top
  • Each application (e.g., GMail, Chrome, etc.) has its own dedicated Linux process with 1+ threads that have access to the code of that app's files. A process only executes the activities of its own app (not other apps).

Question #1: Assume activities A, B, and C belong to App1 and activities X, Y, and Z belong to App2. If my Task has A->B on its backstack already and an implicit intent is sent to start Z, I am assuming that Z is then added to this Task's backstack. Correct?

Follow-on Question #2: When I am interacting with Z of my Task, the process running App2 code is actually being executed (since it is the owner of Z's code/files). Then, if I press the Back button and navigate back to A, the process of App2 is stopped and the process of App1 is now executed (since it is the owner of A's code/files). Correct?

0

There are 0 best solutions below