O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

onErrorReturnItem

Again, .onErrorReturnItem() is a lot like .onErrorReturn() but is even simpler. In this case, it just returns a constant that was specified at the time an Observable was created, as here:

Observable.<String>error(new Error("Crash!"))        .onErrorReturnItem("ReturnItem")        .subscribe(item -> {            log("subscribe", item);        }, e -> log("subscribe", e));

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required