📜  不推荐使用 viewmodelproviders - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:23.041000             🧑  作者: Mango

代码示例1
// With ViewModelFactory   
val viewModel = ViewModelProvider(this, YourViewModelFactory).get(YourViewModel::class.java)


//Without ViewModelFactory
val viewModel = ViewModelProvider(this).get(YourViewModel::class.java)