According to the android activity life cycle, the only call that needs to be made (if the activity ever leaves the Running state, which is usually expected) is onPause() .
So, I have to assume that there are scenarios in which it makes sense to implement onStop() and onDestroy() , although in reality they are not guaranteed.
I understand that onStop() should be implemented when it is possible that the action will return to the Running state through the Stopped state (why would it do it and not return directly - this is another question).
But the need for onDestroy() , when I can put all the clear / save state in onPause() , I donβt understand.
Can you describe the situation with a real application (i.e., not an analogy with driving a car, etc.), in which it would be advisable to implement onDestroy() ?
android android-activity activity-lifecycle
uTubeFan May 24 '11 at 21:49 2011-05-24 21:49
source share