Async Task using RxJava2 in Android
in general, I believe it would be better if you included this in some sort of chain. What I mean here:


don't return void, rather an Observable
don't show the progress dialog in the function, rather delegate it to the part responsible for UI. Same with displayData()
where's the whole function called? What calls it? Where is it located, in an Activity?

doOnNext() can be gotten rid of - there's no action in here
Are you getting just one result at a time? I mean, is the function called perpetually on and on and on, and you just evaluate the result each time? Perhaps you could use Single or Maybe, which is better suited for single results.


Good luck and hope we'll both learn something along the way.