Reputation: 3869
I'm new with Reactive. I want to collect data from different sources and process the result. To do that I'm using the Observable.zip() method. But it never emits so the callback is never called. What have I done wrong?
Here is an example of the code I try to implement:
public void loadData() {
Observable.zip(
Observable.just(42),
Observable.just(43),
Observable.just(44),
(integer, integer2, integer3) ->
Log.d(TAG, "zip method called") // This is never called
);
}
Upvotes: 0
Views: 1192
Reputation: 2835
You have to subscribe to the Observable to make it do it's job.
For example you might do this:
public void loadData() {
Observable.zip(
Observable.just(42),
Observable.just(43),
Observable.just(44),
(integer, integer2, integer3) ->
Log.d(TAG, "zip method called")
)
.subscribe(); //you can also send 3 parameters optional parameters, onNext action, onError action and onComplete action.
}
Upvotes: 3