How to get latest value from BehaviorSubject?
As it turns out, the reason behind it is that RxAndroid by default depends on RxJava 1.0.4, where Subjects didn't expose getValue
nor hasValue
yet.
Thanks to @akarnokd for helping me realize that.
As it turns out, all it takes to resolve the problem is to manually add a dependency on latest version of RxJava side-by-side with RxAndroid dependency in build.gradle
. As of now that would be:
compile 'io.reactivex:rxandroid:0.24.0'
compile 'io.reactivex:rxjava:1.0.11'
See https://github.com/ReactiveX/RxAndroid/issues/171