I make a request
@SuppressLint("CheckResult") private Observable<Exchange> kursRequest(){ String base = exchange.getBase(); String symbols=symbolsWaluta; return request(base,symbols); } private Observable<Exchange> request(String nameWaluta, String nameWaluta2){ return Network.getService().getDara(nameWaluta,nameWaluta2) .subscribeOn(Schedulers.single()) .observeOn(AndroidSchedulers.mainThread()); } Subscribe
@SuppressLint("CheckResult") public String getKurs() { kursRequest() .subscribe (s->kurs=s.getRates().get(symbolsWaluta).toString()) ; return kurs; } I get the result-
kurs
BUT I receive old, that is it is updated, then when I do a repeated request. That is, if kurs==0 , then with 1 request it will remain kurs==0 , it will be updated only with 2 requests. How to fix to get the result right away?