Yes it's possible and really easy after you have fully understand the logic. But you probably confuse a bit observeOn() and subscribeOn() operators :)
uiObservable
.switchMap(o -> return anotherUIObservable)
.subscribeOn(AndroidSchedulers.mainThread()) // means that the uiObservable and the switchMap above will run on the mainThread.
.switchMap(o -> return networkObservable) //this will also run on the main thread
.subscribeOn(Schedulers.newThread()) // this does nothing as the above subscribeOn will overwrite this
.observeOn(AndroidSchedulers.mainThread()) // this means that the next operators (here only the subscribe will run on the mainThread
.subscribe(result -> doSomething(result))
Maybe this is what you want:
uiObservable
.switchMap(o -> return anotherUIObservable)
.subscribeOn(AndroidSchedulers.mainThread()) // run the above on the main thread
.observeOn(Schedulers.newThread())
.switchMap(o -> return networkObservable) // run this on a new thread
.observeOn(AndroidSchedulers.mainThread()) // run the subscribe on the mainThread
.subscribe(result -> doSomething(result))
Bonus: I have written a post about these operators, hope it helps