Skip to content

Instantly share code, notes, and snippets.

@julianfalcionelli
Last active May 16, 2017 00:03
Show Gist options
  • Save julianfalcionelli/e18347c76f947d07ecdbaa7fc7b0ee74 to your computer and use it in GitHub Desktop.
Save julianfalcionelli/e18347c76f947d07ecdbaa7fc7b0ee74 to your computer and use it in GitHub Desktop.
Observable Example with Lambda
//---
Observable
.just(1, 2, 3, 4, 5)
.filter(integer -> integer % 2 != 0)
.subscribe(
integer -> Log.i(TAG, String.valueOf(integer)),
error -> Log.e(TAG, "Error"),
() -> Log.i(TAG, "No more results")
);
//This will log 1 - 3 - 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment