[英]How can I use app.fragment with LiveData and ViewModel
I want to use ViewModelProviders.of
(app.fragment) to create a ViewModel
, but I find that the function of
is only supported in the v4 package. 我想用
ViewModelProviders.of
(app.fragment)创建一个ViewModel
,但我发现,功能of
在V4包只支持。 What should I do? 我该怎么办?
Do not use android.app.Fragment
, the entire class is now deprecated . 不要使用
android.app.Fragment
, 整个类现在已被弃用 。 The support library version does everything in a much better, safer, more predictable way. 支持库版本以更好,更安全,更可预测的方式执行所有操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.