Application Fundamentals--Coordinating activities(activity实例间协调)

Coordinating activities---activity实例间协调

When one activity starts another, they both experience lifecycle transitions. One pauses and may stop, while the other starts up. On occasion, you may need to coordinate these activities, one with the other.【翻译:当一个activity实例发出intent请求去启动另外一个activity实例的时候,这两个实例当前生命周期状态都将发生变化,一个进入暂停状态继而可能被stop,另一个被启动。有时候开发者可能需要两个实例相互协调。】

The order of lifecycle callbacks is well defined, particularly when the two activities are in the same process:---翻译:生命周期回调顺序是预定好的,尤其是当两个实例属于同一个进程的时候。

   1. The current activity's onPause() method is called.---翻译:当前实例的onPause()方法被系统调用。
   2. Next, the starting activity's onCreate(), onStart(), and onResume() methods are called in sequence.---翻译:之后,被启动的实例的onCreate(), onStart(), 和 onResume()方法被系统依次调用。
   3. Then, if the starting activity is no longer visible on screen, its onStop() method is called.---翻译:然后,如果被启动的实例如果不在屏幕上显示的话,该实例的 onStop()方法被系统调用执行。

你可能感兴趣的:(UP)