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
There is an error happening when you are trying to geocode the location.
Caused by: java.io.IOException: Timed out waiting for response from server at android.location.Geocoder.getFromLocation(Geocoder.java:136)
When you call subscribe with one Action1
as a parameter it only handles calls to onNext
and if an error happens the app will crash.
You need to subscribe with:
subscribe(new Subscriber() {
@Override
public void onNext(Location location) { /*Handle the location updates*/ }
@Override
public void onCompleted() { }
@Override
public void onError(Throwable e) { }
})