I used rxjava2[2.1.8] delay Operation in my Foreground Service 。Normal use ok, but when Turn off the screen for a while ,delay Operation cannot work,but the takeUntil Operation can use to cancel the invalid delay。my code:
Observable.just(1).delay(downtime, TimeUnit.SECONDS)
.doOnDispose({
//valid all the time
})
.takeUntil(observable)
.subscribe({
request()
})
RxJava doesn't have any Android specific integration. If your code is not working in some tricky Android OS situations it usually means that you are doing something wrong with Android Sdk integration. In your case it could be one of the following:
RxAndroid
RxAndroid provides Android specific schedulers but have no effect on operators
Please ask such platform specific questions on StackOverflow.
thanks @TarasMazepa ,I'll refer to your ideas