@Override public void onResult(Status status) { if (status.isSuccess()) { SantaLog.v( TAG, String.format( "App Indexing API: Recorded [" + title + "] view successfully.")); } else { SantaLog.e( TAG, "App Indexing API: There was an error recording the view." + status.toString()); } } });
@Override public void onResult(Status status) { mApiClient.disconnect(); // disconnecting here because of a potential race if (status.isSuccess()) { SantaLog.v( TAG, "App Indexing API: Recorded [" + title + "] view end successfully."); } else { SantaLog.e( TAG, "App Indexing API: There was an error recording the view end." + status.toString()); } } });
@Override public Completable loginWithGoogle(final Activity activity) { return Single.create((SingleOnSubscribe<AuthCredential>) e -> { googleClient = new GoogleApiClient.Builder(activity) .addApi(Auth.GOOGLE_SIGN_IN_API, gso) .build(); Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleClient); activity.startActivityForResult(signInIntent, RC_GOOGLE_SIGN_IN); googleSignInCompleteListener = result -> { if(result.isSuccess()) { AuthCredential credential = GoogleAuthProvider.getCredential(result.getSignInAccount().getIdToken(), null); e.onSuccess(credential); } else { e.onError(new Exception(result.getStatus().toString())); } }; }).flatMapCompletable(authCredential -> signInWithCredential(activity, authCredential)); }
public StatusException(Status status) { super(status.toString()); this.status = status; }
public StatusException(Result result) { super(result.getStatus().toString()); this.result = result; }
/** * Callback invoked when PlaceAutocompleteFragment encounters an error. */ @Override public void onError(Status status) { Log.e(TAG, "onError: Status = " + status.toString()); Toast.makeText(this, "Place selection failed: " + status.getStatusMessage(), Toast.LENGTH_SHORT).show(); }
@Override public void onResult(PlaceBuffer places) { if (!places.getStatus().isSuccess()) { // Request did not complete successfully Log.e(TAG, "Place query did not complete. Error: " + places.getStatus().toString()); places.release(); return; } // Get the Place object from the buffer. final Place place = places.get(0); // Format details of the place for display and show it in a TextView. mPlaceDetailsText.setText(formatPlaceDetails(getResources(), place.getName(), place.getId(), place.getAddress(), place.getPhoneNumber(), place.getWebsiteUri())); // Display the third party attributions if set. final CharSequence thirdPartyAttribution = places.getAttributions(); if (thirdPartyAttribution == null) { mPlaceDetailsAttribution.setVisibility(View.GONE); } else { mPlaceDetailsAttribution.setVisibility(View.VISIBLE); mPlaceDetailsAttribution.setText(Html.fromHtml(thirdPartyAttribution.toString())); } Log.i(TAG, "Place details received: " + place.getName()); places.release(); } };
if (!d.isEmpty()) { com.google.android.gms.common.api.Status insertStatus = Fitness.HistoryApi.insertData(mClient, d).await(1, TimeUnit.MINUTES); Log.i(TAG, insertStatus.getStatus().toString()); if (!insertStatus.isSuccess()) throw new Exception("There was a problem inserting basal metabolic rate data.");
@Override public void onResult(PlaceBuffer places) { if (!places.getStatus().isSuccess()) { // Request did not complete successfully Log.e(TAG, "Place query did not complete. Error: " + places.getStatus().toString()); places.release(); return; } // Get the Place object from the buffer. final Place place = places.get(0); mMap.moveCamera(CameraUpdateFactory.newLatLng(place.getLatLng())); Log.i(TAG, "Place details received: " + place.getName()); places.release(); } };
Log.e(TAG, "Error: Status = " + status.toString()); } else if (resultCode == RESULT_CANCELED) {
@Override public void onResult(@NonNull PlaceBuffer places) { if(!places.getStatus().isSuccess()){ Log.d(TAG, "onResult: Place query did not complete successfully: " + places.getStatus().toString()); places.release(); return;
UserError.Log.d(TAG, "DataMap retry: " + dataMap + " sent to: " + node.getDisplayName()); } else { UserError.Log.e(TAG, "ERROR on retry: failed to send DataMap: " + result.getStatus().toString());
if ( status != null ) Log.e( LOG_TAG, status.toString() ); break; default:
UserError.Log.d(TAG, "DataMap retry: " + dataMap + " sent to: " + node.getDisplayName()); } else { UserError.Log.e(TAG, "ERROR on retry: failed to send DataMap: " + result.getStatus().toString());