Skip to content
New issue

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

VastBaseFragment在使用ViewModel通信时会出现问题 #42

Closed
SakurajimaMaii opened this issue Apr 17, 2022 · 1 comment
Closed
Assignees
Labels
错误 代码运行出错 高优先级(High) 对系统有重大影响,只有解决它之后,才能去完成其他任务

Comments

@SakurajimaMaii
Copy link
Owner

可能是构建ViewModel时ViewModelProvider的owner问题

@SakurajimaMaii SakurajimaMaii added 错误 代码运行出错 高优先级(High) 对系统有重大影响,只有解决它之后,才能去完成其他任务 labels Apr 17, 2022
@SakurajimaMaii SakurajimaMaii self-assigned this Apr 17, 2022
@SakurajimaMaii
Copy link
Owner Author

修改前

ViewModelProvider(this).get(getVmClass(this, 1))

修改后

ViewModelProvider(requireActivity()).get(getVmClass(this, 1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
错误 代码运行出错 高优先级(High) 对系统有重大影响,只有解决它之后,才能去完成其他任务
Projects
None yet
Development

No branches or pull requests

1 participant