Please, return Observable!
Why not return Observable insted callback? Callback is bad way!
@MrVilkaman Is there any soecific reason for that, which I am not aware of??
Of course:
-
You hold link on listener. So it is way to memory leak.
-
You lost information about cause of error for example if I will want show snackbar when internet connection is lost (IOException or NetworkErrorException) and show alert dialog when handle simple HttpException. How I can do without instanceOf ?
-
I want continue work with response ( save to DB, convert to other model, etc) or combine with another queries. And I want use RxJava for this. How I can do this? Use Observable.create? I think it is bad way!