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

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章