yayaa / LocationManager

Simplify getting user's location for Android
807 stars 187 forks source link

Allow distance to be set when keepTracking(true) #24

Closed donhill closed 7 years ago

donhill commented 7 years ago

It looks like a 0 being passed for distance when getting updates. This allows onLocationChange to keep firing even when location.distanceTo(oldLocation) == 0.0F. For now I will calculate the distance but this seems like a lot of radio usage.

The following line is passing in 0 for distance setting

currentUpdateRequest = new UpdateRequest(provider, timeInterval, 0, locationChangeListener);

https://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener)

yayaa commented 7 years ago

You're right! I should update this :) Will be done, within current developments and announce here. Thanks for reporting 👍

yayaa commented 7 years ago

v2.0.0 is just released, and it is possible now.

donhill commented 7 years ago

Great thanks for the update.