These are chat archives for ReactiveX/RxJava

19th
Mar 2017
Haris Kljajić
@devharis
Mar 19 2017 21:18
A batch insert returns a Iterable of items, how do I cast it to a List of items with RxJava?
Zak Taccardi
@ZakTaccardi
Mar 19 2017 21:20
Observable.just(iterable).map(iterable -> iterable.toList())
.toList() would be how I'd do it in Kotlin, Java has a slightly different call
But it's not Rx related
Dorus
@Dorus
Mar 19 2017 21:23
collect in RxJava to make a custom collect function.
Haris Kljajić
@devharis
Mar 19 2017 21:37
Reason I'm asking is that I've tried with.map(Lists::newArrayList);
But if I use it I get a weird exception
Dorus
@Dorus
Mar 19 2017 21:40
Mm looks correct to me. I'm not using (Rx)Java a lot lately but i can give this a spin.
What are the errors? Does .map(it -> Lists.newArrayList(it)) works? That should be the same right?
Haris Kljajić
@devharis
Mar 19 2017 21:43
Haha, caught the error now...
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/collect/Lists;:D
Aren't that lib builtin in android studio?
Zak Taccardi
@ZakTaccardi
Mar 19 2017 21:47
That class is missing at runtime