I am using rxjava in my Android app to handle network requests asynchronously. Now I would like to retry a failed network request only after a certain time has passed.
Inspired by Paul's answer, and if you are not concerned with retryWhen
problems stated by Abhijit Sarkar, the simplest way to delay resubscription with rxJava2 unconditionnaly is :
source.retryWhen(throwables -> throwables.delay(1, TimeUnit.SECONDS))
You may want to see more samples and explanations on retryWhen and repeatWhen.