How to simulate killing activity to conserve memory?

后端 未结 8 1747
清酒与你
清酒与你 2020-12-15 15:22

Android doc say:

\"When the system, rather than the user, shuts down an activity to conserve memory, ... \"

But how to simulate

8条回答
  •  伪装坚强ぢ
    2020-12-15 16:22

    For the purposes of debugging onRestoreInstanceState(), just change the screen orientation ([Ctrl]-[F11] in the emulator). Your activity will be destroyed and recreated, and the onSaveInstanceState()/onRestoreInstanceState() pair will be invoked.

提交回复
热议问题