I am studying APP. Let me ask you a question about the life cycle.
I understand that when you run the application, onCreate() runs only once. But if you turn on the application, press the home button, and touch the icon again to enter the app, onCreate() again I was able to see it run.
This leads to a situation in which objects created in onCreate() are re-new, and
Aren't you going to lose all the information that was on the original object because you re-designate the object?
If this situation is correct, is there any solution?
android
OnSaveInstanceState() exists for that occasion.
https://developer.android.com/training/basics/activity-lifecycle/recreating?hl=ko
See Google's official document here.
© 2024 OneMinuteCode. All rights reserved.