Rxjava newbie, I searched and found no relevant operators (I just didn’t find them)
I want to judge the obtained data in onNext
.
Refresh different interfaces according to the type
carried by the activity to the data. The current method is to onNext
中switch + case
The code is ugly.
I would like to ask if there is such an operator? (I thought about it and it seems that I can actively throw an exception, but this is not good)
天蓬老师2017-05-16 13:36:43
No, such logic needs to be written by yourself. You can extract the processing of different types into a separate method, which is easy to call and very concise.