-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
The below code gives the exception - (IllegalStateException: Disposable already set!):
Single.just("Amit")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SingleObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(String value) {
}
@Override
public void onError(Throwable e) {
}
});
But when I remove subscribeOn and observeOn like below it works :
Single.just("Amit")
.subscribe(new SingleObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(String value) {
}
@Override
public void onError(Throwable e) {
}
});
Reactions are currently unavailable