I have a boolean Observable. I want to emit value(another boolean) only if the current boolean value is different from preview.
booleanObservable
// which operator here
.subscribe(new Consumer<Boolean>() {
@Override
public void accept(Boolean emittedBoolean) throws Exception {
// do something with emittedBoolean
}
});
you should use this : distinctUntilChanged()