Skip to content

Instantly share code, notes, and snippets.

@kevalpatel2106
Created January 4, 2017 11:49
Show Gist options
  • Save kevalpatel2106/b15db5b933b17e12d6c5d273325c3f95 to your computer and use it in GitHub Desktop.
Save kevalpatel2106/b15db5b933b17e12d6c5d273325c3f95 to your computer and use it in GitHub Desktop.
Observable<Integer> observable = Observable.from(new Integer[]{1,2,3,4,5}) //emit 1 to 5
.skip(2); //Skip first two elements
observable
.subscribeOn(Schedulers.newThread())
.observeOn(Schedulers.io())
.subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
Log.d("Observer", "Output:" + integer);
}
});
//Output will be : 3, 4, 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment