Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save givemepassxd999/587eee1fd88c92f0698c5541c3bcb882 to your computer and use it in GitHub Desktop.
Save givemepassxd999/587eee1fd88c92f0698c5541c3bcb882 to your computer and use it in GitHub Desktop.
Observable.fromIterable<MainActivity.Album>(getAlbum())
.flatMap<MainActivity.Song> {Observable.fromIterable<MainActivity.Song>(it.songs)}
.filter { it.songTime > 100}
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe { it.songName }
implementation "io.reactivex.rxjava2:rxjava:2.2.9"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment