Retrying the request using Retrofit 2

后端 未结 7 902
天涯浪人
天涯浪人 2020-12-12 17:35

How can I add retry functionality to the requests sent by Retrofit 2 library. Something like:

service.listItems().enqueue(new Callback>         


        
相关标签:
7条回答
  • 2020-12-12 18:17

    I think for android we no need to go for retrofit for this.We can make use of Workmanager (which predefine android api). We can use "ListenableWorker.Result.SUCCESS","ListenableWorker.Result.RETRY" ,etc and achieve the above goals.

    0 讨论(0)
提交回复
热议问题