I have a class that goes to decrease the image but I’m currently on AsyncTask, now I want to replace it because AsyncTask is now deprecated.So can someone help me out with a workaround Here is my code: Answer You could change your decreaseImageSize to accept a callback as a parameter. In this case, the function will no longer need
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
Any Rx operator which could FlatMap and return both the output
I want to know if there’s an appropriate RxJava operator for my use-case. I have the below two methods. These are retrofit interfaces. fun getSources(): Single
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