Skip to content

Commit 36e5b95

Browse files
committed
Fixes: #166 Check location settings emits just a single value
1 parent 5207480 commit 36e5b95

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

android-reactive-location/src/main/java/pl/charmas/android/reactivelocation2/ReactiveLocationProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ReactiveLocationProvider(Context ctx) {
6969
/**
7070
* Creates location provider with custom handler in which all GooglePlayServices callbacks are called.
7171
*
72-
* @param ctx preferably application context
72+
* @param ctx preferably application context
7373
* @param handler on which all GooglePlayServices callbacks are called
7474
* @see com.google.android.gms.common.api.GoogleApiClient.Builder#setHandler(android.os.Handler)
7575
*/
@@ -312,7 +312,7 @@ public Observable<ActivityRecognitionResult> getDetectedActivity(int detectInter
312312
* Observable that can be used to check settings state for given location request.
313313
*
314314
* @param locationRequest location request
315-
* @return observable that emits check result of location settings
315+
* @return observable that emits single check result of location settings
316316
* @see com.google.android.gms.location.SettingsApi
317317
*/
318318
public Observable<LocationSettingsResult> checkLocationSettings(final LocationSettingsRequest locationRequest) {
@@ -322,7 +322,8 @@ public Observable<LocationSettingsResult> checkLocationSettings(final LocationSe
322322
public Observable<LocationSettingsResult> apply(GoogleApiClient googleApiClient) {
323323
return fromPendingResult(LocationServices.SettingsApi.checkLocationSettings(googleApiClient, locationRequest));
324324
}
325-
});
325+
})
326+
.take(1);
326327
}
327328

328329
/**

0 commit comments

Comments
 (0)