mrmans0n / smart-location-lib

Android library project that lets you manage the location updates to be as painless as possible
1.65k stars 352 forks source link

location does not update - Android 8.0 #258

Open bruno-siqueira-simples opened 5 years ago

bruno-siqueira-simples commented 5 years ago

location does not update even using LocationParams.NAVIGATION. Does anyone know how to solve it?

mona-baharlou commented 5 years ago

I implement it in this way, and it works on android 8 but not on android 7 :(((

 private void startLocationListener() {

        Logger.d("startLocationListener:begin smartLocation");

        LocationParams.Builder builder = new LocationParams.Builder()
                .setAccuracy(trackingAccuracy)
                .setDistance(trackingDistance)
                .setInterval(interval);

        LocationGooglePlayServicesWithFallbackProvider provider =
                new LocationGooglePlayServicesWithFallbackProvider(this);

        SmartLocation smartLocation = new SmartLocation.Builder(this).logging(true).build();

        smartLocation.location(provider).continuous()
                .config(builder.build()).start(this);

        smartLocation.activity().start(this);
    }
@Override
    public void onLocationUpdated(Location location) {
              //do sth with location
               setLocationValues(location);
    }
DillionApple commented 5 years ago

Same issue. I also tried the method in Android official documentation, but it still cannot get the location update.