Reputation: 124
I am trying to convert this RxJava/RxAndroid lesson to RxKotlin/RxAndroid. At the method at Example5 I get error from picture
My getNotesObservable() function is:
fun getNotesObservable(): Observable<Note>{
val notes: List<Note> = prepareNotes()
return Observable.create {
for (note in notes) {
if (!it.isDisposed){ // onNext only if observable is not disposed
it.onNext(note)
}
}
if (!it.isDisposed) {
it.onComplete()
}
}
}
and part with error is:
disposable.add(
getNotesObservable().subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.map{
it.note = it.note.toUpperCase()
}
.subscribeWith(getNotesObserver())
)
So, what's should I change in my code?
Upvotes: 0
Views: 325