I have seen other questions here related to this error but still not able to fix. Plus I'm asking this question because unlike other questions here, I'm getting this error only when I convert the code to Kotlin from Java.
I'm using this same RxJava code in Java, it works fine. I converted to Kotlin and it gives this error -
Kotlin Compilation Error : None of the following functions can be called with the arguments supplied
var observable : Observable<Bitmap> = Observable.just(bitmap)
var observer:Observer<Bitmap> = Observer<Bitmap>() {
fun onSubscribe(d: Disposable) {
disposable = d
}
fun onNext(orientedBitmap:Bitmap) {
// do something
}
fun onError(e:Throwable) {
}
fun onComplete() {
}
}
observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
// It shows the error here
.subscribe(observer)
Can anyone explain what's wrong here?