完成()和活动的生命周期生命周期

2023-09-12 04:23:42 作者:Please、远离我

我学习的Andr​​oid编程类的,我对如何完成()适合活动的生命周期快速的问题。

I'm learning Android programming for a class, and I have a quick question about how finish() fits into the Activity lifecycle.

当您拨打一个电话来完成(),开始什么生命周期回调?我presume它的onPause(),然后的onStop()和的onDestroy()。这是正确的?

When you make a call to finish(), what lifecycle callback is started? I presume it's onPause(), then onStop() and onDestroy(). Is this correct?

真的,我只是想确保它不会直接跳转到的onDestroy()。

Really, I just want to make sure that it doesn't jump straight to onDestroy().

推荐答案

您是正确的。在onPause,的onStop,的onDestroy。

You are correct. onPause, onStop, onDestroy.

这里是文档。