我遵循了指南,直到我必须为我的ViewModel类使用自定义构造函数(这引发了运行时崩溃...UserViewModel> has no zero argument constructor)。extends ViewModel>, Provider<ViewModel>> creators;
public ViewModelFactory(Map<Class<?extends ViewModel>, Provider<
com.packageName.Models.SettingsViewModel> has no zero argument constructor 我正在按照文档创建DataStore和视图模型,所以我可能没有在androidx.datastore:datastore-preferences:1.0.0-alpha05"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktxpreferences[PreferencesKeys.RESOLUTION] = resolu
我有以下几个类: The ViewModel class MealPlanViewModel @AssistedInject constructor(private val mealPlanRepository: MealPlanRepository, @Assisted private val canteenId: String) : ViewModel() {
// AssistedInjectcode for using ViewModel injection with runtime paramete