I am trying to download file with RxAndroid and Retrofit, I want my Observable can emit download status on processing.
My expectation:
Observable.create()
.emit(PENDING)
.emit(START)
.flatMap(() -> {
emit(DOWNLOADING);
return apiService.download();
})
.onSuccess(() -> {
emit(SUCCESS);
)
.onError(() -> {
emit(ERROR);
})