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

后端 未结 5 1927
遥遥无期
遥遥无期 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 06:01

    Its Working

    API Level 25 or below use this

        var et_user_name = findViewById(R.id.et_user_name) as EditText
    

    API Level 26 or Above use this

        val et_user_name: EditText = findViewById(R.id.et_user_name)
    

    Happy Coding !

提交回复
热议问题