@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final LocationRequestBuilder locationRequestBuilder = new LocationRequestBuilder(this); locationRequestBuilder .addLastLocation( LocationManager.NETWORK_PROVIDER, new LocationTime(30, TimeUnit.SECONDS), false) .addRequestLocation(LocationManager.GPS_PROVIDER, new LocationTime(10, TimeUnit.SECONDS)) .setDefaultLocation(new Location(LocationManager.PASSIVE_PROVIDER)) .create() .subscribe( new Subscriber<Location>() { @Override public void onCompleted() {} @Override public void onError(Throwable e) { Log.d(getClass().getSimpleName(), e.toString()); } @Override public void onNext(Location location) { final String name = Thread.currentThread().getName(); Log.d( getClass().getSimpleName(), location != null ? location.toString() : "Location is empty =("); } }); }