I'm studying Android Activity lifecycle and I'm pretty confused about some topics. I found, even on this forum, documents/books that state the opposite of other document/books.
For example, the book I bought states:"onPause()
... Steps should be taken within this method to store any persistent data required by the activity (such as data stored to a content provider, database or file)...
On the other hand, android official guidelines state "onPause()
execution is very brief, and does not necessarily afford enough time to perform save operations. For this reason, you should not use onPause() to save application or user data, make network calls, or execute database transactions; such work may not complete before the method completes. Instead, you should perform heavy-load shutdown operations during onStop()"
But, we know that onStop()
is not sure to be called everytime!!!
Who's right??
Thank you in advance.