In my app I am using ReactiveLocationProvider library (link). I subscribe for updates in the onCreate method. It works fine when the device is online but if I switch my wifi
If you still wish to implement only one method and handle error too, then probably you can have abstract CustomSubscriber like below.
public abstract class CustomSubscriber extends Subscriber {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(T t) {
}
}
Implement this way
getObservable()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new CustomSubscriber>() {
@Override
public void onNext(List list) {
}
});
hope some one will benefited.