We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//注:不能使用new 关键字创建MyViewModel对象,否则MyViewModel感知不到生命周期 val viewModel = ViewModelProvider(this).get(MyViewModel::class.java) 大神请教,viewModel的创建,在kt下如上写法,在java下必须要new,上述说不能使用new,请问java下viewModel如何创建?
The text was updated successfully, but these errors were encountered:
我的意思是不能new MyViewModel(),ViewModelProvider Java的话该怎样就怎样
new MyViewModel()
ViewModelProvider
Sorry, something went wrong.
OK, 明白了,文件理解有误,谢谢大神解答!
No branches or pull requests
//注:不能使用new 关键字创建MyViewModel对象,否则MyViewModel感知不到生命周期
val viewModel = ViewModelProvider(this).get(MyViewModel::class.java)
大神请教,viewModel的创建,在kt下如上写法,在java下必须要new,上述说不能使用new,请问java下viewModel如何创建?
The text was updated successfully, but these errors were encountered: