当按下 backpress 导航回上一个活动时调用生命周期?

发布于 2024-11-30 19:26:40 字数 88 浏览 5 评论 0原文

当同一应用程序中的另一个活动启动,然后单击后按按钮导航回该活动时,会调用什么活动状态?

返回上一个Activity的过程中调用了什么生命周期方法?

What activity state is called when another activity, in the same application, is launched, and then the backpress button is clicked to navigate back to it?

What lifecylce method is called during the proccess of going back to the previous activity?

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

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

发布评论

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

评论(2

携余温的黄昏 2024-12-07 19:26:40

onPause() 在启动 Activity B 时在 Activity A 中调用。在 Activity B 中调用后退按钮后,在 Activity A 中调用 onResume()

onPause() is called in Activity A when it launches Activity B. After the back button is called in Activity B, onResume() is called in Activity A.

A君 2024-12-07 19:26:40

回溯过程中调用了什么lifecylce方法
之前的活动?

根据 docsonPause()onStop(),可能还有onDestroy()。除了生命周期文档之外,您可能还需要阅读 任务和返回堆栈

What lifecylce method is called during the proccess of going back to
the previous activity?

According to the docs: onPause(), onStop(), and possibly onDestroy(). In addition to the lifecycle documentation, you might want to read the docs on Tasks and Back Stack.

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