谁能帮助我删除Dagger注释并手动创建对象 当我使用dagger2时,我有这段代码
@Inject
ViewModelProvider.Factory mViewModelFactory;
@Override
public BlogViewModel getViewModel() {
mBlogViewModel = ViewModelProviders.of(this, mViewModelFactory).get(BlogViewModel.class);
return mBlogViewModel;
}
我正在尝试将其转换为Kotlin并使用手动初始化 如何在这里创建mViewModelFactory?
viewModelFactory = BlogViewModel.Factory(getViewModel().dataManager,getViewModel().schedulerProvider)
我在这条线上崩溃了
mBlogViewModel = ViewModelProviders.of(this, mViewModelFactory).get(BlogViewModel.class)