答案 0 :(得分:0)
您需要类而不是实例,但是必须创建类的实例才能获取类本身,请尝试以下操作:
val wrapper = Wrapper<String>()
Rx2AndroidNetworking.post(someUrl)
.build()
.getObjectSingle(wrapper.javaClass)
OR
val wrapper = Wrapper<String>()
Rx2AndroidNetworking.post(someUrl)
.build()
.getObjectSingle(wrapper::class.java)
OR
val wrapper = Wrapper<String>()
val s: Class<Wrapper<String>> = wrapper.javaClass
Rx2AndroidNetworking.post(someUrl)
.build()
.getObjectSingle(s)