TabWidget 活动处理 - 它每次都会创建一个新活动吗?
当 TabWidget 使用意图为每个选项卡指定目标 Activity 时,除了默认操作之外,是否对 Activity Stack 上的这些 Activity 有任何特殊处理?
例如,如果我的应用程序有选项卡 A、B 和 C,并且我按此顺序单击它们——A、B、A、C、A、B——活动堆栈将如何变化?
我对默认操作的理解是,如果每次在意图上调用 startActivity() ,堆栈就会不断加载活动的新实例:A、AB、ABA、ABAC、ABACA、ABACAB
很难相信就是这样虽然有效...似乎这会浪费资源并且可能是无止境的。谁能告诉我这实际上是如何运作的?
When a TabWidget is using intents to designate the target Activity for each tab, is there any special handling of those Activities on the Activity Stack outside of the default operation?
For Instance, if my app has tabs A, B, and C, and I click them in this order––A, B, A, C, A, B––how will the Activity stack change?
My understanding of the default operation, if startActivity() is called each time on the intent, would have the Stack keep loading up new instances of the activities: A, AB, ABA, ABAC, ABACA, ABACAB
It's hard to believe that's how it works though... Seems like it would be a waste of resources and could be endless. Can anyone tell me how this will actually work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TabWidget
的内部活动不会进入堆栈。TabWidget
不会在每次单击选项卡时创建新活动。The
TabWidget
's inner activities do not go on the stack.TabWidget
does not create new activities on each tab click.Tabwidget 负责管理活动。所有未显示的活动都会暂停,并在 Tabhost 中选择活动时恢复。
The Tabwidget is responsible for managing the Activities. All Activities that are not shown are paused and are resumed at the moment the Activity is selected in the Tabhost.