Problem
Error:(29, 37) error: cannot find symbol method subscribeOn(Scheduler)
This happens compiling this code borrowed from http://blog.danlew.net/2015/03/02/dont-break-the-chain/#comment-2388677116
final Observable.Transformer schedulersTransformer =
observable -> observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
Environment
- Android Studio 2.0
- Retrolambda
- Compiled with Java 8
Same configuration as you, this is working for me:
private final Observable.Transformer<Object, Object> mSchedulersTransformer;
Later...
mSchedulersTransformer = observable -> observable .subscribeOn(postThread.get()) .observeOn(mainThread.get());
Finally...
@SuppressWarnings("unchecked") protected <T> Transformer<T, T> applySchedulers() { return (Transformer<T, T>) mSchedulersTransformer; }