Android 如何发送'Class<;项目>;`到'ItemLiveData'类构造函数?

Android 如何发送'Class<;项目>;`到'ItemLiveData'类构造函数?,android,kotlin,android-livedata,Android,Kotlin,Android Livedata,我有这门课: class ItemLiveData<I>(private val classType: Class<I>): LiveData<I>() { //I need to use classType } 我得到: Type inference failed. Expected type mismatch: required: ItemLiveData<Item> found: ItemLiveData<MyReposit

我有这门课:

class ItemLiveData<I>(private val classType: Class<I>): LiveData<I>() {
    //I need to use classType
}
我得到:

Type inference failed. Expected type mismatch: 
required: ItemLiveData<Item>
found: ItemLiveData<MyRepository>
类型推断失败。预期类型不匹配:
必需:ItemLiveData
找到:ItemLiveData

如何将
Class
发送到
ItemLiveData
类构造函数?谢谢。

ItemLiveData(Class)
应该是
ItemLiveData(Item::Class.java)
谢谢您的回复。让我查一查,然后给你回电话。
return ItemLiveData(Class<Item>)
return ItemLiveData(javaClass)
Type inference failed. Expected type mismatch: 
required: ItemLiveData<Item>
found: ItemLiveData<MyRepository>