From 36e5b95e03ed0bdc95e8fbc00f93af75ab41a645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Charmas?= Date: Wed, 4 Oct 2017 17:11:16 +0200 Subject: [PATCH] Fixes: #166 Check location settings emits just a single value --- .../reactivelocation2/ReactiveLocationProvider.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/android-reactive-location/src/main/java/pl/charmas/android/reactivelocation2/ReactiveLocationProvider.java b/android-reactive-location/src/main/java/pl/charmas/android/reactivelocation2/ReactiveLocationProvider.java index 27ae4cbd..f69c4608 100644 --- a/android-reactive-location/src/main/java/pl/charmas/android/reactivelocation2/ReactiveLocationProvider.java +++ b/android-reactive-location/src/main/java/pl/charmas/android/reactivelocation2/ReactiveLocationProvider.java @@ -69,7 +69,7 @@ public ReactiveLocationProvider(Context ctx) { /** * Creates location provider with custom handler in which all GooglePlayServices callbacks are called. * - * @param ctx preferably application context + * @param ctx preferably application context * @param handler on which all GooglePlayServices callbacks are called * @see com.google.android.gms.common.api.GoogleApiClient.Builder#setHandler(android.os.Handler) */ @@ -312,7 +312,7 @@ public Observable getDetectedActivity(int detectInter * Observable that can be used to check settings state for given location request. * * @param locationRequest location request - * @return observable that emits check result of location settings + * @return observable that emits single check result of location settings * @see com.google.android.gms.location.SettingsApi */ public Observable checkLocationSettings(final LocationSettingsRequest locationRequest) { @@ -322,7 +322,8 @@ public Observable checkLocationSettings(final LocationSe public Observable apply(GoogleApiClient googleApiClient) { return fromPendingResult(LocationServices.SettingsApi.checkLocationSettings(googleApiClient, locationRequest)); } - }); + }) + .take(1); } /**