从后台调用什么方法

What method is called from the backstack

Activity 在前一个 activity 上的 BackPress 之后再次从后台堆栈显示时调用什么方法。我试过 onActivityReenter 但它没有像我预期的那样被调用。

如果 Activity 没有从 OS 中销毁。然后它将首先调用 onRestart(),然后是 onStart()onResume()。如果 Activity 已被销毁,那么它将调用 onCreate() 而不是 onRestart()

阅读更多here and here

这是生命周期图: