07-20-2023, 04:17 PM
I am making a timer in Android using RxJava. I need to make a timer in RxJava to emit an observable every second. I have tried the following but with no luck. Any thoughts on what I am doing wrong?
Observable.interval(1000L, TimeUnit.MILLISECONDS)
.timeInterval()
.observeOn(AndroidSchedulers.mainThread())
.subscribe({Log.d(LOG_TAG, "&&&& on timer") })
Observable.interval(1000L, TimeUnit.MILLISECONDS)
.timeInterval()
.observeOn(AndroidSchedulers.mainThread())
.subscribe({Log.d(LOG_TAG, "&&&& on timer") })