I would need an Observable, for example to provide a system clock, which does not need to pass anything in onNext(). I couldn\'t find a signature that would allow me to do that.
RxJava 2 Wiki:
RxJava 2.x no longer accepts null values and the following will yield NullPointerException immediately or as a signal to downstream.
...
This means that
Observable
can no longer emit any values but only terminate normally or with an exception. API designers may instead choose to defineObservable
with no guarantee on what Object will be (which should be irrelevant anyway)
It means that you can't use Void
and do Observable.just(null)
.
Use Object
or some other simple type instead:
Observable.just(new Object());