Android not killing activities from stack when memory is low

后端 未结 5 1487
旧时难觅i
旧时难觅i 2021-01-02 10:10

We\'ve been developing an application that has a drop down dashboard that allows the users to navigate throughout the app. The navigation is not very standard since this men

5条回答
  •  佛祖请我去吃肉
    2021-01-02 10:34

    I was also under the impression that the system will kill old activities to free memory, according to android developer guide:

    "When the system stops one of your activities (such as when a new activity starts or the task moves to the background), the system might destroy that activity completely if it needs to recover system memory. When this happens, information about the activity state is lost. If this happens, the system still knows that the activity has a place in the back stack, but when the activity is brought to the top of the stack the system must recreate it (rather than resume it). In order to avoid losing the user's work, you should proactively retain it by implementing the onSaveInstanceState() callback methods in your activity."

    see link: android activities

提交回复
热议问题