June 2017
Intermediate to advanced
400 pages
8h 44m
English
Before we look at the subscribe() method a bit more, note that you likely will not need to use Observable.create() often. It can be helpful in hooking into certain sources that are not reactive, and we will see this in a couple of places later in this chapter. But typically, we use streamlined factories to create Observables for common sources.
In our previous example with Observable.create(), we could have used Observable.just() to accomplish this. We can pass it up to 10 items that we want to emit. It will invoke the onNext() call for each one and then invoke onComplete() when they all have been pushed:
import io.reactivex.Observable; public class Launcher { public static void main(String[] args) { Observable
Read now
Unlock full access