I have an Observable in my oncreate and I want to get the results in my main topic. But since AndroidScheduler.mainThread only works with Java Observable, I can not compile it. Here is the code
val L=List(1,2,3) val a=Observable.from(L).observeOn(AndroidSchedulers.mainThread()).subscribe(i=>println(i))
Here "a" is the observed value of rx.scala.lang. And this is a compile time error that I get
Error:(38, 70) type mismatch; found : rx.Scheduler required: rx.lang.scala.Scheduler val a=Observable.from(L).observeOn(AndroidSchedulers.mainThread()).subscribe(i=>println(i)) ^
Please help in solving this.
source share