Created
June 17, 2019 09:34
-
-
Save givemepassxd999/79b102e726485dc131382cbefa041ad7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.fromIterable(getAlbum()) | |
.flatMap(new Function<Album, ObservableSource<Song>>() { | |
@Override | |
public ObservableSource<Song> apply(Album album) throws Exception { | |
return Observable.fromIterable(album.getSongs()); | |
} | |
}) | |
.filter(new Predicate<Song>() { | |
@Override | |
public boolean test(@NonNull Song song) throws Exception { | |
return false; | |
} | |
}) | |
.subscribeOn(Schedulers.newThread()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Consumer<Song>() { | |
@Override | |
public void accept(Song song) throws Exception { | |
System.out.println(song.getSongName()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment