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

The final onExceptionResumeNext() block

To complete this section, we will include the whole content of onExceptionResumeNext(). After all the preceding steps are merged into one flow, the final code will look like this:

v2(StorIOFactory.get(this)        .get()        .listOfObjects(StockUpdate.class)        .withQuery(Query.builder()                .table(StockUpdateTable.TABLE)                .orderBy("date DESC")                .limit(50)                .build())        .prepare()        .asRxObservable())        .take(1)        .flatMap(Observable::fromIterable)

It's a lengthy piece of code, and it becomes even longer if you consider other (parent) parts of the StockUpdate item flow. In later chapters, we will explore how to make this more manageable.

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