nhaarman
08/11/2017, 1:51 PMSingle.just("Test")
.subscribeOn(Schedulers.computation())
.flatMapObservable {
println("1: ${Thread.currentThread()}")
Observable.just(1)
.observeOn(AndroidSchedulers.mainThread())
// .doOnNext { println("2: ${Thread.currentThread()}") }
}
.subscribe {
println("3: ${Thread.currentThread()}")
}
Should print the following?
1: Thread[RxComputationThreadPool-1,5,main]
3: Thread[main,5,main]
When I run this, this is the output instead:
1: Thread[RxComputationThreadPool-1,5,main]
3: Thread[RxComputationThreadPool-1,5,main]
Funny thing is that when I uncomment the line with "2:", this is the output:
1: Thread[RxComputationThreadPool-1,5,main]
2: Thread[main,5,main]
3: Thread[main,5,main]