Reputation: 403
I'm trying to run this example from here
Observable<String> values = Observable.create(o -> {
o.onNext("Hello");
o.onCompleted();
});
Subscription subscription = values.subscribe(
v -> System.out.println("Received: " + v),
e -> System.out.println("Error: " + e),
() -> System.out.println("Completed")
);
Aside from the fact that I can't use Lambda in Android Studio, there is no Observable.create(). The only option I have is Observable.class?
I'm using version 1.1.6 and getting the library via Gradle.
Upvotes: 0
Views: 244
Reputation: 25573
IntelliJ has probably imported java.util.*
which includes java.util.Observable
Add an import for rx.Observable
and it should work again.
Upvotes: 5