Запрос Location Location, который я использую для получения обновления Location с использованием FusedLocationProviderClient, приведен ниже.
mFusedLocationClient.requestLocationUpdates(getLocationRequest(), mLocationCallback, Looper.myLooper());
private LocationRequest getLocationRequest() {
final int UPDATE_INTERVAL_MS = 1 * 1000;
LocationRequest mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(UPDATE_INTERVAL_MS);
mLocationRequest.setFastestInterval(UPDATE_INTERVAL_MS / 2);
mLocationRequest.setSmallestDisplacement(1);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
return mLocationRequest;
}
Я ездил на велосипеде в течение 10 минут.Пройденное расстояние было около 5 км.Мой код получил только 4 местоположения.Я не могу найти проблему с кодом.