Hi, I have an question about Activity and ViewMode...
# android
j
Hi, I have an question about Activity and ViewModel。 I used
Copy code
ViewModelProviders.of(MyActivity::this).get(ViewModel::class.java)
to create a view model by activity. And view model has same instance after a configuration changed (e.g. rotation screen). It's all right and work fine. But I wonder how does view model keep it self's instance even activity has new instance after a configuration changed ?
😶 1