janishar / android-mvp-architecture

This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
https://janisharali.com
Apache License 2.0
4.44k stars 1.24k forks source link

Use getSchedulerProvider and getCompositeDisposable in services. #66

Closed Themesaul closed 6 years ago

Themesaul commented 6 years ago

What is the way to use getCompositeDisposable and getSchedulerProvider in a service (For example SyncService)?

I have several services, one of them from Firebase (to update the user's push token) but I have to make an HTTP call from the service and I could not do it. I tried using dependency injection but I could not.

amitshekhariitbhu commented 6 years ago

Create a baseService and inject in that. Have the method getCompositeDisposable and getSchedulerProvider in that baseService.

Themesaul commented 6 years ago

It works perfect. It is very clean. It is perfect

dpnkrg commented 4 years ago

example?