Skip to content

Commit 44924bd

Browse files
Add Schedulers in each observable in Zip Example
1 parent 3037e3b commit 44924bd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/src/main/java/com/rxjava2/android/samples/ui/operators/ZipExampleActivity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public void onClick(View view) {
4848
}
4949

5050
/*
51-
* Here we are getting two user list
52-
* One, the list of cricket fans
53-
* Another one, the list of football fans
54-
* Then we are finding the list of users who loves both
55-
*/
51+
* Here we are getting two user list
52+
* One, the list of cricket fans
53+
* Another one, the list of football fans
54+
* Then we are finding the list of users who loves both
55+
*/
5656
private void doSomeWork() {
5757
Observable.zip(getCricketFansObservable(), getFootballFansObservable(),
5858
new BiFunction<List<User>, List<User>, List<User>>() {
@@ -77,7 +77,7 @@ public void subscribe(ObservableEmitter<List<User>> e) {
7777
e.onComplete();
7878
}
7979
}
80-
});
80+
}).subscribeOn(Schedulers.io());
8181
}
8282

8383
private Observable<List<User>> getFootballFansObservable() {
@@ -89,7 +89,7 @@ public void subscribe(ObservableEmitter<List<User>> e) {
8989
e.onComplete();
9090
}
9191
}
92-
});
92+
}).subscribeOn(Schedulers.io());
9393
}
9494

9595
private Observer<List<User>> getObserver() {

0 commit comments

Comments
 (0)