How to retry a consumed Observable?
问题 I am trying to re-execute a defined observable that failed. Using Retrofit2 and RxJava2 together i want to retry a specific request with its subscription and behavior when clicking a button. is that possible? service.excecuteLoginService(url, tokenModel, RetrofitManager.apiKey) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(....) 回答1: An option is to create Publisher, which emission is controlled by your button. final PublishSubject<Object>