com.google.android.gms.common.api.Status.toString()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中com.google.android.gms.common.api.Status.toString()方法的一些代码示例,展示了Status.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Status.toString()方法的具体详情如下:
包路径:com.google.android.gms.common.api.Status
类名称:Status
方法名:toString

Status.toString介绍

暂无

代码示例

代码示例来源:origin: google/santa-tracker-android

@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());
    }
  }
});

代码示例来源:origin: google/santa-tracker-android

@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());
    }
  }
});

代码示例来源:origin: chat-sdk/chat-sdk-android

@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));
}

代码示例来源:origin: patloew/RxFit

public StatusException(Status status) {
  super(status.toString());
  this.status = status;
}

代码示例来源:origin: florent37/RxGps

public StatusException(Result result) {
  super(result.getStatus().toString());
  this.result = result;
}

代码示例来源:origin: googlesamples/android-play-places

/**
 * 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();
}

代码示例来源:origin: tangqi92/MyGooglePlaces

Toast.makeText(getContext(), "Error contacting API: " + status.toString(),
    Toast.LENGTH_SHORT).show();
Log.e(TAG, "Error getting autocomplete prediction API call: " + status.toString());
autocompletePredictions.release();
return null;

代码示例来源:origin: mitchtabian/Google-Maps-Google-Places

Toast.makeText(getContext(), "Error contacting API: " + status.toString(),
    Toast.LENGTH_SHORT).show();
Log.e(TAG, "Error getting autocomplete prediction API call: " + status.toString());
autocompletePredictions.release();
return null;

代码示例来源:origin: xbenjii/PokeMock

Toast.makeText(getContext(), "Error contacting API: " + status.toString(),
    Toast.LENGTH_SHORT).show();
Log.e(TAG, "Error getting autocomplete prediction API call: " + status.toString());
autocompletePredictions.release();
return null;

代码示例来源:origin: tangqi92/MyGooglePlaces

@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();
  }
};

代码示例来源:origin: kochka/WeightLogger

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.");

代码示例来源:origin: xbenjii/PokeMock

@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();
  }
};

代码示例来源:origin: googlesamples/android-play-places

Log.e(TAG, "Error: Status = " + status.toString());
} else if (resultCode == RESULT_CANCELED) {

代码示例来源:origin: mitchtabian/Google-Maps-Google-Places

@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;

代码示例来源:origin: NightscoutFoundation/xDrip

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());

代码示例来源:origin: OceanLabs/Android-Print-SDK

if ( status != null ) Log.e( LOG_TAG, status.toString() );
 break;
default:

代码示例来源:origin: jamorham/xDrip-plus

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());

相关文章