activity的生命週期有
onCreate
onStart
onResume
onPause
onStop
onRestart
onDestory
一般情況下比如說有兩個activity,分別叫A,B。
當在A 裏面激活B 組件的時候, A會調用onPause()方法,然後B調用onCreate() ,onStart(), onResume()。
這個時候B覆蓋了A的窗體, A會調用onStop()方法。
如果B是個透明的窗口,或者是對話框的樣式, 就不會調用A的onStop()方法。
如果B已經存在於Activity棧中,B就不會調用onCreate()方法。