当按下 backpress 导航回上一个活动时调用生命周期?
当同一应用程序中的另一个活动启动,然后单击后按按钮导航回该活动时,会调用什么活动状态?
返回上一个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.根据 docs:
onPause()
,onStop()
,可能还有onDestroy()
。除了生命周期文档之外,您可能还需要阅读 任务和返回堆栈。According to the docs:
onPause()
,onStop()
, and possiblyonDestroy()
. In addition to the lifecycle documentation, you might want to read the docs on Tasks and Back Stack.