viewmodelinject

Dagger-Hilt: @ViewModelInject is not injecting MyViewModel and crash?

倾然丶 夕夏残阳落幕 提交于 2020-08-07 05:36:08
问题 In exploring the ViewModelInject of Dagger-Hilt, I follow the example in https://developer.android.com/training/dependency-injection/hilt-jetpack#viewmodels I try to inject the ViewModel into my activity as follow import android.app.Application import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import androidx.activity.viewModels import androidx.hilt.Assisted import androidx.hilt.lifecycle.ViewModelInject import androidx.lifecycle.* import androidx.savedstate