Convert Observable<List<Car>> to a sequence of Observable<Car> in RxJava
You can map an Observable<List<Car>>
to Observable<Car>
like so:
yourListObservable.flatMapIterable(x -> x)
Note that flatMapping might not preserve the order of the source observable. If the order matters to you, use concatMapIterable
. Read here for more details.
you can use this
flatMap { t -> Observable.fromIterable(t) }