.
subscribeOn , Observable , .
observeOncan be used at different points (and many times, if necessary) in your observed chain to transfer control between threads. (You can check this by checking if you are in the main thread or not in each of these blocks).
ParseObservable.find(myQuery)
.map(myMapFunc())
.doOnNext(obj -> {
}
.subscribeOn(AndroidSchedulers.handlerThread(new Handler()))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<>() {
next -> {
},
error -> {
Log.e("error","error",e);
},
() -> {
}
});
source
share