在阅读《Android 编程大书呆子牧场指南第 4 版》一书时,遇到了使用 lazy
时出现错误:Property delegate must have a 'getValue(MainActivity, KProperty<*>)' method. None of the following functions is suitable: public inline operator fun <T> Lazy<QuizViewModel>.getValue(thisRef: Any?, property: KProperty<*>): QuizViewModel defined in kotlin
的问题。
private val quizViewModel: QuizViewModel by lazy {
ViewModelProvider.(this).get(QuizViewModel::class.java)
}
英语不是我的母语,这是我在stackoverflow上的第一个问题,所以我很抱歉错误