How to make retry network calls when network errors appear with rxJava in Android.
Here is my rxJave code:
RxTextView.textChanges(searchInput)
.debounce(500, TimeUnit.MILLISECONDS)
.map(CharSequence::toString)
.filter(s -> !s.isEmpty())
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(Schedulers.io())
.switchMap(query -> getTypedPlaces(query))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(results -> showResult(results));
It works very well but I need to retry network request when connection was down.