yayaa / LocationManager

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

Stop location updates #51

Closed marktonni closed 7 years ago

marktonni commented 7 years ago

Hi,

Once the service is started and getlocation() is called, how do you stop getting location updates? I can stop the service but I'm still getting the location updates, this is in your sample project. I`m using keepTracking(true) and this config.

LocationConfiguration awesomeConfiguration = new LocationConfiguration.Builder() .keepTracking(true) .useDefaultProviders(new DefaultProviderConfiguration.Builder() .requiredTimeInterval(3 1000) .acceptableAccuracy(10.0f) .setWaitPeriod(ProviderType.GPS, 30 1000) .build()) .build();

thank you in advance.

yayaa commented 7 years ago

You can call cancel method on LocationManager object.