What is Activity.finish() method doing exactly?

前端 未结 12 1910
别那么骄傲
别那么骄傲 2020-11-22 16:16

I\'m developing android applications for a while, and followed a lot of posts about activity life cycle, and application\'s life cycle.

I know Activity.finish

12条回答
  •  春和景丽
    2020-11-22 16:31

    @user3282164 According to the Activity life-cycle it should go through onPause() -> onStop() -> onDestroy() upon calling finish().

    The diagram does not show any straight path from [Activity Running] to [onDestroy()] caused by the system.

    onStop() doc says "Note that this method may never be called, in low memory situations where the system does not have enough memory to keep your activity's process running after its onPause() method is called."

提交回复
热议问题