问题描述
我跟着一些教程,但弄糊涂了活动栈和任务。
I followed some tutorials but got confused with "Activity stack" and "Task".
- 由于双方开始创建新的活动时。
- 在活动栈保持活动导航历史,任务是活动的序列。
时,这是唯一的区别由一个或多个任务(S),该活动栈?
Is this is only difference that Activity stack made up of one or more task(S)?
给出一些例子吧。
推荐答案
活动和任务
如前所述,一个活动可以启动另一个,包括在不同的应用程序来定义。举个例子,你想要让用户显示某些位置的街道地图。还有已经可以做到这一点的活动,让你所有的活动需要做的就是把具备所需的信息的意图对象并把它传递给startActivity()。地图查看器会显示地图。当用户点击BACK键,你的活动将重新出现在屏幕上。
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.
要的用户,它会显得好象地图浏览器是相同的应用程序作为活动的一部分,即使它在另一个应用程序中定义和运行在该应用程序的过程。 Android的维护通过保持两种活动在同一个任务,这个用户体验。简单地说,一个任务是用户体验作为一个应用程序。这是一组相关的活动,安排在一个堆栈。
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.
任务=应用=组活动。
这篇关于任务和活动叠加:什么是两者之间的区别。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!