The Activity documentation says, "You should always call up to your
superclass when implementing these methods."  It does not specify that
you must call "super" FIRST before running your own code.  However,
this doc says,

http://developer.android.com/guide/topics/fundamentals/activities.html

"Your implementation of these lifecycle methods must always call the
superclass implementation before doing any work.", implying that you
must call super FIRST (i.e. super.onPause(), super.onDestroy(), etc).

When dealing with onCreate(), onStart(), onResume(), it makes sense to
call super first.  However, when dealing with onPause(), onStop(),
onDestroy(), it makes more logical sense to perform your own work
first (cleanup in onPause, onDestroy(), BEFORE calling through to the
superclass, which will effectively invalidate your activity once you
do that.

What is the correct paradigm?  Call through to super first always, or
just call through to super at some point in your method?


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to