Does onDestroy() or finish() actually kill the activity?

后端 未结 3 1731
失恋的感觉
失恋的感觉 2021-01-02 23:15

Actually I know i am asking about the simple and basic concept of Android. But I am a little bit confused about these finish() and onDestroy() meth

3条回答
  •  天命终不由人
    2021-01-03 00:02

    The finish() kills the activity and releases memory... unless you have some reference stored that is leaked... for example on methods like onRetainNonConfigurationInstance()

    When you press the back button what is called is the finish() method that than calls onPause, onStop, onDestroy.

提交回复
热议问题