先前章節:
onCreate() onStarte() onResume()
-------> -------> ------->
Nonexistent Created Started Resumed
<------- <------- <-------
onDestroy() onStop() onPause()
|--Created: has instance in memory--------------
|--Started: is visible to the user
|--Resumed: active
(accept user input)
State | In memory? | Visible to user? | In foreground? | 情境 |
---|---|---|---|---|
Nonexistent | N | N | N | 刪app |
Created | Y | N | N | 切換到另一頁面 |
Started | Y | Y(部分可見) | N | 被彈窗阻擋的原畫面 |
Resumed | Y | Y | Y | 正進行互動的頁面 |
觀察Activity生命週期請見後續章節