有人知道如何正确使用 onActivityReenter 吗?

Does someone know how to use onActivityReenter properly?

我刚刚意识到 android 有另一个方法叫做 onActivityReenter

这是做什么用的?可以像onActivityResult一样使用吗?

Documentation 说是用于转换,但不是 100% 的用途。

根据文档

The purpose of this function is to let the called Activity send a hint about its state so that this underlying Activity can prepare to be exposed. A call to this method does not guarantee that the called Activity has or will be exiting soon. It only indicates that it will expose this Activity's Window and it has some data to pass to prepare it.

因此您可以从另一个 activity 获取数据,即使它仍然是 运行。但是对于 onActivityResult 我们在 activity 完成时获取数据。