我正在尝试将从观察者发出的项转换为另一种类型。我尝试了map函数,但没有成功。
mObservable = RxTextView.textChanges(mEditText).map(a -> Float.parseFloat(a.toString()));如上所示,我得到了以下编译器错误:
Error:(37, 70) error: incompatible types: inference variable R has incompatible bounds
equality constraints: CharSequence
lower bounds: Float
where R,T are type-variables:
R extends Object declared in method <R>map(Func1<? super T,? extends R>)
T extends Object declared in class Observable是否有任何操作符可以实现我需要的CharSequence到Float的转换?
发布于 2017-01-13 22:09:40
你试过Cast()吗?
参考https://github.com/ReactiveX/RxJava/wiki/Transforming-Observables
https://stackoverflow.com/questions/41643953
复制相似问题