When activity is destroyed due to insufficient memory

Asked 2 years ago, Updated 2 years ago, 23 views

When activity is destroyed, run it again and recover in the process Will the Intent (to be exact, bundle contained in the Intent) used during the above Activity be recovered? If it is restored, is the recovery time data at the time of destruction? Or is it data at the time of startActivity?

android

2022-09-21 19:18

1 Answers

When an activity is restored after it has ended due to insufficient memory, Android manages (save/restore) the state of View only (if Android:id exists) by default. Therefore, the required information among Intent's Bundles used during the activity must be stored and restored directly using the following functions.

Please refer to the following documentation for sample code and more information on this part.


2022-09-21 19:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.