-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Description
Hi,
@ViewModelInject has deprecated. I change to the following and I still got an error.
"java.lang.RuntimeException: Cannot create an instance of class com.example.room_test.ui.tasks.TasksViewModel"
Is there a way I can solve the problem? Many thanks.
KC
@hiltviewmodel
class TasksViewModel @Inject constructor(
private val taskDao: TaskDao
) : ViewModel() {
val tasks = taskDao.getTasks().asLiveData()
}
Metadata
Metadata
Assignees
Labels
No labels