Issue
If I, for example, need to keep some very important data which the user can edit within my app, should I need to save them every time user changes such data or is it ok if I would save it within onPause(), onStop() or onDestroy() methods?
Can somehow application end without any of those methods calling? (For instance when battery runs out)
Solution
This certainly can't be done in onDestroy(). According to the documentation:
There are situations where the system will simply kill the activity's hosting process without calling this method (or any others) in it, so it should not be used to do things that are intended to remain around after the process goes away.
So yes, the application can end without calling any of the lifecycle methods.
Answered By - Wilder Pereira
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.