Task and Activity stack : what is difference between both.

前端 未结 1 435
余生分开走
余生分开走 2021-02-01 04:20

I followed some tutorials but got confused with \"Activity stack\" and \"Task\".

  • Because both starts when a new activity is created.
  • Activity stack keeps
相关标签:
1条回答
  • 2021-02-01 04:31

    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.

    0 讨论(0)
提交回复
热议问题