Hey Edio, the issue you are having is quite frequent one. Let’s only focus on the first line:
Tomek Polański
21

Thank you for your detailed response Tomek, you did a very good explanation of my issue!

Following your answer, I’ve successfully implemented it as follows:

Observable.fromCallable(new Func0<Boolean>() {
@Override
public Boolean call() {
return this.method(); // RxNewThreadScheduler-X
}}).subscribeOn(Schedulers.newThread())
.subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean aBoolean) {
// RxNewThreadScheduler-X
}
});

(As you can see, both callable and subscriber called from the same thread)

Here is another example of playing with those operators in Android Studio, result in calling the callback from another thread and subscribe to from the UI thread:

Observable.fromCallable(new Func0<Boolean>() {
@Override
public Boolean call() {
return this.method(); // RxNewThreadScheduler-X
}
}).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean aBoolean) {
// UI
}
});
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.