Esempio n. 1
0
 public void run() {
   if (zzNE.hasResolution()) {
     try {
       int i = zzNF.getActivity().getSupportFragmentManager().getFragments().indexOf(zzNF);
       zzNE.startResolutionForResult(zzNF.getActivity(), (i + 1 << 16) + 1);
       return;
     } catch (android.content.nder.SendIntentException sendintentexception) {
       zzh.zza(zzNF);
     }
     return;
   }
   if (GooglePlayServicesUtil.isUserRecoverableError(zzNE.getErrorCode())) {
     GooglePlayServicesUtil.showErrorDialogFragment(
         zzNE.getErrorCode(), zzNF.getActivity(), zzNF, 2, zzNF);
     return;
   } else {
     zzh.zza(zzNF, zzND, zzNE);
     return;
   }
 }
  @Override
  public void onConnectionFailed(ConnectionResult connectionResult) {
    // Could not connect to Google Play Services.  The user needs to select an account,
    // grant permissions or resolve an error in order to sign in. Refer to the javadoc for
    // ConnectionResult to see possible error codes.
    Log.d(tag, "onConnectionFailed:" + connectionResult);

    if (!this.resolving && this.shouldResolve) {
      if (connectionResult.hasResolution()) {
        try {
          connectionResult.startResolutionForResult(this.getActivity(), RC_SIGN_IN);
          this.resolving = true;
        } catch (IntentSender.SendIntentException e) {
          Log.e(tag, "Could not resolve ConnectionResult.", e);
          this.resolving = false;
          this.googleApiClient.connect();
        }
      } else {
        GooglePlayServicesUtil.showErrorDialogFragment(
            connectionResult.getErrorCode(), this.getActivity(), RC_SIGN_IN);
      }
    }
  }