You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix for multiple subscribers on Observables. Fixed bug which did not handle Exceptions after successful resolution. Added tests for resolution handling with multiple subscribers. Added Transformer to help with resuming with another RxFit Observable after an Exception, but propagate an unsuccessful resolution.
This library wraps the Fit API in [RxJava](https://github.com/ReactiveX/RxJava) Observables. No more managing GoogleApiClients! Also, the authorization process for using fitness data is handled by the lib.
if (resultCode == Activity.RESULT_OK && observable.apiClient != null) {
198
-
observable.apiClient.connect();
199
-
} else {
200
-
observable.subscriber.onError(newGoogleAPIConnectionException("Error connecting to GoogleApiClient, resolution was not successful.", connectionResult));
197
+
for(BaseObservableobservable : observableSet) {
198
+
for (Map.Entry<GoogleApiClient, Subscriber> entry : (Set<Map.Entry<GoogleApiClient, Subscriber>>) observable.subscriptionInfoHashMap.entrySet()) {
199
+
if (!entry.getValue().isUnsubscribed()) {
200
+
if (resultCode == Activity.RESULT_OK) {
201
+
try {
202
+
entry.getKey().connect();
203
+
} catch (Throwableex) {
204
+
entry.getValue().onError(ex);
205
+
}
206
+
} else {
207
+
entry.getValue().onError(newGoogleAPIConnectionException("Error connecting to GoogleApiClient, resolution was not successful.", connectionResult));
0 commit comments