The RxAndroid library

The RxAndroid library provides a scheduler that uses the main thread. The following example code shows how to use this scheduler:

Flowable.fromIterable(listOf(1, 2, 3))
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { println(it) }

The preceding snippet shows how to use the observeOn method to handle emitted values on the main thread.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.196