I followed some tutorials but got confused with \"Activity stack\" and \"Task\".
Activities and Tasks
As noted earlier, one Activity
can start another, including one defined in a different Application
. Suppose, for example, that you'd like to let users display a street map of some location. There's already an activity that can do that, so all your activity needs to do is put together an Intent
object with the required information and pass it to startActivity()
. The map viewer will display the map. When the user hits the BACK key, your activity will reappear on screen.
To the user, it will seem as if the map viewer is part of the same application as your activity, even though it's defined in another application and runs in that application's process. Android maintains this user experience by keeping both activities in the same task. Simply put, a task is what the user experiences as an "application". It's a group of related activities, arranged in a stack.
Task = Application = Set of activities.