5
"ข้อมูลไม่เพียงพอที่จะสรุปพารามิเตอร์ T" กับ Kotlin และ Android
ฉันพยายามที่จะทำซ้ำ ListView ต่อไปนี้ในแอป Android ของฉันโดยใช้ Kotlin: https://github.com/bidrohi/KotlinListView ขออภัยฉันได้รับข้อผิดพลาดไม่สามารถแก้ไขได้ด้วยตนเอง นี่คือรหัสของฉัน: MainActivity.kt: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val listView = findViewById(R.id.list) as ListView listView.adapter = ListExampleAdapter(this) } private class ListExampleAdapter(context: Context) : BaseAdapter() { internal var sList = arrayOf("Eins", "Zwei", "Drei") private val mInflator: LayoutInflater init { this.mInflator = LayoutInflater.from(context) …