diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-05-06 14:31:17 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-05-06 15:32:04 +0200 |
commit | 1ade5e3aa67dc0994b0de7f381b5e0a6592ece12 (patch) | |
tree | e58b42e911150be2805208c77b6cacc5b01df4f0 /platform/android/MapboxGLAndroidSDK/src/main | |
parent | def05ab5f887f0bba5f2243ac2992bfda9f9b976 (diff) | |
download | qtlocation-mapboxgl-1ade5e3aa67dc0994b0de7f381b5e0a6592ece12.tar.gz |
[android] #4748 - add javadoc for unregistering location listeners
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java index e64b6378e2..c148b02a10 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationServices.java @@ -9,13 +9,26 @@ import android.location.LocationManager; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.util.Log; + import com.mapbox.mapboxsdk.telemetry.TelemetryLocationReceiver; import com.mapzen.android.lost.api.LocationRequest; import com.mapzen.android.lost.api.LostApiClient; + import java.util.concurrent.CopyOnWriteArrayList; /** * Manages locational updates. Contains methods to register and unregister location listeners. + * <p> + * <ul> + * <li>You can register a {@link LocationListener} with {@link #addLocationListener(LocationListener)} to receive location updates.</li> + * <li> You can unregister a {@link LocationListener} with {@link #removeLocationListener(LocationListener)}.</li> + * </ul> + * <p/> + * <p> + * Note: If registering a listener in your Activity.onResume() implementation, you should unregister it in Activity.onPause(). + * (You won't receive location updates when paused, and this will cut down on unnecessary system overhead). + * Do not unregister in Activity.onSaveInstanceState(), because this won't be called if the user moves back in the history stack. + * </p> */ public class LocationServices implements com.mapzen.android.lost.api.LocationListener { |