gpt4 book ai didi

android - 来自 navArgs 的数据(Bundle)在系统杀死和重新创建 Activity(和 Fragment)后是否仍然存在?

转载 作者:行者123 更新时间:2023-12-04 02:28:02 26 4
gpt4 key购买 nike

Google 的 Ian Lake 已经回答了这个问题。有人建议我在 StackOverflow 上重新创建问题并自己回答,所以它可能会帮助其他搜索它的人:)
使用 Navigation API 和 SafeArgs 时:

val args: SomeFragmentArgs by navArgs()
args Activity 被系统杀死并重新创建后,字段是否保持其值?
换句话说:发送到 Fragment 的 Bundle 是否存在?

最佳答案

Ian Lake(来自 Google)给我的答案:

The Bundle of arguments sent to a Fragment are indeed part of theFragment's saved instance state. There's no reason to store it againseparately


所以确实,它确实存在。

关于android - 来自 navArgs 的数据(Bundle)在系统杀死和重新创建 Activity(和 Fragment)后是否仍然存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66082901/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com