Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter convertView

后端 未结 4 698
刺人心
刺人心 2021-01-03 21:54

I got this error just after converted the adapter code to Kotlin:

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.         


        
4条回答
  •  -上瘾入骨i
    2021-01-03 22:42

    Change your convertView in getView from non-null to nullable

    override fun getView(position: Int, convertView: View, parent: ViewGroup): View {
    

    to

    override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
    

提交回复
热议问题