“Not enough information to infer parameter T” with Kotlin and Android

后端 未结 5 1930
遥遥无期
遥遥无期 2020-12-13 05:17

I\'m trying to replicate the following ListView in my Android app using Kotlin: https://github.com/bidrohi/KotlinListView.

Unfortunately I\'m getting an error I\'m u

5条回答
  •  遥遥无期
    2020-12-13 05:58

    I would suggest you to use synthetics kotlin Android extension:

    https://kotlinlang.org/docs/tutorials/android-plugin.html

    https://antonioleiva.com/kotlin-android-extensions/

    In your case the code will be something like this:

    init {
       this.label = row.label
    }
    

    As simple as that ;)

提交回复
热议问题