2

I see examples of both, so which is the best way to override onDestroy() in an Activity...

@Override
protected void onDestroy() {

    super.onDestroy();

    /*
     *  Clean up and stop listeners etc. AFTER calling super.
     */
    myLeakyObject = null;
}

...or...

@Override
protected void onDestroy() {

    /*
     *  Clean up and stop listeners etc. BEFORE calling super.
     */
    myLeakyObject = null;

    super.onDestroy();

}

...or doesn't it matter?

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
  • Yes, thanks. From looking at the comments and answers on that page, they all seem to concur that you should (or may as well) always declare `super.onDestroy()` it at the end - i.e., as in my second example. – ban-geoengineering Aug 31 '15 at 00:10

0 Answers0