A new way to create a ViewModel, CreationExtras?
Androidx-Lifecycle has recently moved to version 2.5.0, one of the most important changes being the introduction of the concept of CreatioinExtras. One sentence summarizing the role of CreationExtras: helps us gracefully get initialized parameters when creating ViewModel s
1. Status Quo
Review how ViewModel s have been created so far
val v ...
Posted by Trium918 on Sun, 06 Mar 2022 19:15:30 +0100
android LifeCycle - simple use and detailed principle analysis
Pay attention to my official account: "an an an Android" "learn more knowledge"
What is Lifecycle used for
Lifecycle is used to store information about the lifecycle state of a component, such as an Activity or Fragment, and to allow other objects to observe this state.
More generally, you can get all the life cycle met ...
Posted by coder_ on Mon, 31 Jan 2022 18:19:12 +0100