Skip to content

Tag: rx-java2

How to Filter Data in RxJava in Android

This is the Json data that i need to filter. This my “ViewModel” Class I want to filter the data that i’m getting from json. I only what to display all the data that contains “Bắn cá 2021” using the “game_name” attribute. The “getTips” function that i made have some error. This is my first time to use rxjava in

Void is not a functional interface

I am trying to subscribe observable like : It’s working fine but if I use method reference compiler gives error “void is not a functional iterface” Any one can explain little bit deep? As per me subscriber accept consumer functional interface, which doesn’t return anything but we can print stream data like : Answer Your method reference syntax is wrong.

Why is doOnDispose not called?

When creating an Observable like this: doOnSubcribe is called, doOnDispose is not called. Why is that? Answer You need to use the doFinally() operator. doOnDispose() has a very narrow use case, where the observable is explicitly disposed. In your example, the observable terminates “naturally” by onComplete(). By the time that you call dispose(), the observable is done, and nothing will