我正在练习Kotlin mvvm,在创建视图模型时,我看到了很多堆栈溢出解决方案,但没有找到解决方案。不能创建类视图模型的实例
public class MainViewModel(application: Application,mainBinding = ActivityMainKBinding.inflate(layoutInflater)
我试图在我的活动中实例化UserViewModel,但是它总是给我一个java.lang.RuntimeException: Cannot create an instance of viewmodel这是我的ViewModel的样子 public class UserViewModel extends AndroidViewModel {
public MutableLiveData<L
我在我的ViewModel上得到了以下错误: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class第一个是初始化我的MainActivity.kt类</em
我正在尝试用Android ViewModel添加Room数据库。我跟踪了同一个的这个链接由: com.example.dailyfaithapp.ViewModels.FavouritesViewModel :无法创建类的实例引起的
public class FavouritesViewModel extends ViewModel {
p
我在我的项目中使用MVVM,Retrofit,LiveData,但是在我看到这些链接之前,我得到了这个错误
java.lang.RuntimeException:activity ComponentInfo{ir.orangehat.movieinfo/ir.orangehat.movieinfo.application.home.HomeActivity}: java.lang.RuntimeException:
Cannot create an instance of class ir.orange