I am trying to invoke a method that returns void (Java primitive type). I would like to delay the invoking of a it by a predefined amount of milliseconds. I know this can be simply done using a Handler
by I prefer not to use it.
I tried to do:
Observable.just(getView().setAttachments(attachments)).delay(50, TimeUnit.MILLISECONDS);
However, there is a compilation error, that:
Observable.just(java.lang.Void) cannot be applied to (void)
Is there another way? The reason I would like not to use a Handler
is that the code is defined in Presenter (MVP pattern) and I would not like to use Android specific code in Java only class.
I would prefer it to be a cold Observable, as I would not have to subscribe to it, just invoke the method only once.