0
点赞
收藏
分享

微信扫一扫

Kotlin调用Retrofit 2 使用范型报错:No type arguments expected for class Call



Kotlin调用Retrofit 2 使用范型报错:


  • ​​问题​​
  • ​​解决方法​​


问题

使用Retrofit 2 发送post的时候,

override fun onResponse(call: Call<yourclass>?, response: Response<yourclass>?) {
//成功

}

override fun onFailure(call: Call<yourclass>?, t: Throwable?) {
//失败
}

同时 yourclass的实体class也是已经建立完毕的。但是还是会报下面的报错

No type arguments expected for class Call

解决方法

原问题链接:https://stackoverflow.com/questions/51907280/no-type-arguments-expected-for-class-call

方法:替换引用

//import android.telecom.Call
import retrofit2.Call

Kotlin调用Retrofit 2 使用范型报错:No type arguments expected for class Call_retrofit



举报

相关推荐

0 条评论