Generally, you should?not?use onPause() to store user changes (such as personal information entered into a form) to permanent storage. The only time you should persist user changes to permanent storage withinonPause() is when you're certain users expect the changes to be auto-saved (such as when drafting an email). However, you should avoid performing CPU-intensive work during onPause(), such as writing to a database, because it can slow the visible transition to the next activity (you should instead perform heavy-load shutdown operations during onStop()).
2016-07-03
以上結論有錯誤,onPause和onStop一般都是成對出現,鎖屏會同時調用,非全屏dialog彈出時,兩個都不會調用
2016-07-03
2015-06-05
是呀挺好記的。
基本上可以分3對,ocreate對應ondestroy 銷毀跟創建, onStart對應onStop 可見與不可見都不能操作,onResum對應onPause 都可見 前者可操作后者不可操作。
2015-05-06
說得通俗一點就是:onPause就是你看得見,但是無法操作;onStop就是你看都看不見。
2015-05-06
Generally, you should?not?use onPause() to store user changes (such as personal information entered into a form) to permanent storage. The only time you should persist user changes to permanent storage withinonPause() is when you're certain users expect the changes to be auto-saved (such as when drafting an email). However, you should avoid performing CPU-intensive work during onPause(), such as writing to a database, because it can slow the visible transition to the next activity (you should instead perform heavy-load shutdown operations during onStop()).