调用 LoaderCallbacks.onLoadFinished() 时的规则是什么?

发布于 2024-12-29 09:49:31 字数 288 浏览 1 评论 0原文

对于提供 LoaderManagerActivity 的生命周期,是否有关于何时调用 LoaderCallbacks.onLoadFinished() 的规则?

我从 Android 文档中知道,onLoadFinished() 可能会在 Activity 保存其状态后调用(即可能早在 Activity已暂停),但我想知道框架何时可能会或可能不会调用它。

提前致谢。

Are there rules about when LoaderCallbacks.onLoadFinished() will be called in relation to the lifecycle of the Activity that provided the LoaderManager?

I know from the Android documentation that onLoadFinished() may be called after the Activity has saved its state (i.e. possibly as early as when the Activity is paused), but I'd like to know when else it may or may not be called by the framework.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦屿孤独相伴 2025-01-05 09:49:31

我刚刚查看了 FragmentActivity 和 LoaderManager 源代码,从我所看到的 LoaderCallbacks.onLoadFinished() 可以在 onStart()onStop 之间调用仅 ()

更准确地说,LoaderCallbacks.onLoadFinished() 由变量 mStarted 决定,该变量在 onStart()onStop() 中设置

I've just looked at the FragmentActivity and LoaderManager source code and from what I've seen LoaderCallbacks.onLoadFinished() can be call between onStart() and onStop() only.

More precisely, the LoaderCallbacks.onLoadFinished() is conditioned by the variable mStarted which is set in onStart() and onStop().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文