Android - 正确的方法来覆盖onDestroy()?

时间:2015-08-30 19:40:45

标签: android android-activity android-lifecycle

我看到两者的示例,这是在活动中覆盖onDestroy()的最佳方式...

@Override
protected void onDestroy() {

    super.onDestroy();

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

...或...

@Override
protected void onDestroy() {

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

    super.onDestroy();

}

......或者不重要吗?

0 个答案:

没有答案