映映的博客

安卓方向

ViewModel 时遇到的坑

通过 Activity 获取 ViewModel 时遇到的坑: 在 Application.ActivityLifecycleCallbacks 中的 onActivityCreated 方法中获取 ViewModel 时, Activity 每重建一次, 获取的 ViewModel 都是重新构建...

2019-06-25 16:16:33

阅读数 50

评论数 0

Cannot create an instance of class ViewModel

Make sure your view Model class is public Make sure your view model class constructor is public Make sure you have added the dependency in your gridl...

2019-06-25 15:12:10

阅读数 140

评论数 0

提示
确定要删除当前文章?
取消 删除