當前位置: 首頁>>代碼示例>>Java>>正文


Java OnConnectionFailedListener類代碼示例

本文整理匯總了Java中com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener的典型用法代碼示例。如果您正苦於以下問題:Java OnConnectionFailedListener類的具體用法?Java OnConnectionFailedListener怎麽用?Java OnConnectionFailedListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OnConnectionFailedListener類屬於com.google.android.gms.common.api.GoogleApiClient包,在下文中一共展示了OnConnectionFailedListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initAuth

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
private void initAuth() {
	// Configure sign-in to request the user's ID, email address, and basic
	// profile. ID and basic profile are included in DEFAULT_SIGN_IN.
	GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
			.requestEmail()
			.build();

	// Build a GoogleApiClient with access to the Google Sign-In API and the
	// options specified by gso.
	googleApiClient = new GoogleApiClient.Builder(this)
			.enableAutoManage(this, new OnConnectionFailedListener() {
				@Override
				public void onConnectionFailed(ConnectionResult connectionResult) {
					finish();
				}
			})
			.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
			.build();

	signInSilently();
}
 
開發者ID:alexmiragall,項目名稱:Gourmet,代碼行數:22,代碼來源:MainActivity.java

示例2: zza

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
private void zza(int paramInt, ConnectionResult paramConnectionResult)
{
  Log.w("GmsSupportLifecycleFrag", "Unresolved error while connecting client. Stopping auto-manage.");
  zza localzza1 = (zza)this.zzaqI.get(paramInt);
  if (localzza1 != null)
  {
    zza localzza2 = (zza)this.zzaqI.get(paramInt);
    this.zzaqI.remove(paramInt);
    if (localzza2 != null)
    {
      localzza2.zzaqK.unregisterConnectionFailedListener(localzza2);
      localzza2.zzaqK.disconnect();
    }
    GoogleApiClient.OnConnectionFailedListener localOnConnectionFailedListener = localzza1.zzaqL;
    if (localOnConnectionFailedListener != null) {
      localOnConnectionFailedListener.onConnectionFailed(paramConnectionResult);
    }
  }
  zzps();
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:21,代碼來源:zzns.java

示例3: WearableConnectivity

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public WearableConnectivity(Context context, final WearableEvents wearableEvents)
{
    this.apiClient = new GoogleApiClient.Builder(context).addConnectionCallbacks(new ConnectionCallbacks()
    {
        @Override
        public void onConnected(Bundle connectionHint)
        {
            onClientConnected(wearableEvents);
        }

        @Override
        public void onConnectionSuspended(int cause)
        {
            wearableEvents.onConnectedFail();
        }
    }).addOnConnectionFailedListener(new OnConnectionFailedListener()
    {
        @Override
        public void onConnectionFailed(ConnectionResult result)
        {
            wearableEvents.onConnectedFail();
        }
    }).addApi(Wearable.API).build();
}
 
開發者ID:mauriciotogneri,項目名稱:shoppinglist,代碼行數:25,代碼來源:WearableConnectivity.java

示例4: h

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public final iu h(Context paramAnonymousContext, dt paramAnonymousdt, GoogleApiClient.ApiOptions paramAnonymousApiOptions, GoogleApiClient.ConnectionCallbacks paramAnonymousConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramAnonymousOnConnectionFailedListener)
{
  eg.b(paramAnonymousContext instanceof Activity, "An Activity must be used for Wallet APIs");
  Activity localActivity = (Activity)paramAnonymousContext;
  boolean bool;
  if ((paramAnonymousApiOptions == null) || ((paramAnonymousApiOptions instanceof Wallet.WalletOptions)))
    bool = true;
  else
    bool = false;
  eg.b(bool, "WalletOptions must be used for Wallet APIs");
  Wallet.WalletOptions localWalletOptions1;
  if (paramAnonymousApiOptions != null)
    localWalletOptions1 = (Wallet.WalletOptions)paramAnonymousApiOptions;
  else
    localWalletOptions1 = new Wallet.WalletOptions(null);
  Wallet.WalletOptions localWalletOptions2 = localWalletOptions1;
  return new iu(localActivity, paramAnonymousConnectionCallbacks, paramAnonymousOnConnectionFailedListener, localWalletOptions2.environment, paramAnonymousdt.getAccountName(), localWalletOptions2.theme);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:19,代碼來源:Wallet.java

示例5: createGoogleWearableAPIClient

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
private GoogleApiClient createGoogleWearableAPIClient() {
    return new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(new ConnectionCallbacks() {
                @Override
                public void onConnected(Bundle connectionHint) {
                    Log.d(TAG, "onConnected: " + connectionHint);
                    // Now you can use the data layer API
                }

                @Override
                public void onConnectionSuspended(int cause) {
                    Log.d(TAG, "onDisconnected "+ cause);
                }

            })
            .addOnConnectionFailedListener(new OnConnectionFailedListener() {
                @Override
                public void onConnectionFailed(ConnectionResult result) {
                    Log.d(TAG, "onConnectionFailed: " + result);
                }
            })
                    // Request access only to the Wearable API
            .addApi(Wearable.API)
            .build();
}
 
開發者ID:fblandroidhackathon,項目名稱:weardrone,代碼行數:26,代碼來源:MainActivity.java

示例6: setListeners

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
/**
 * Set location service listeners.
 *
 * @param connectionListener       ConnectionCallbacks.
 * @param connectionFailedListener OnConnectionFailedListener.
 */
void setListeners(ConnectionCallbacks connectionListener,
                  OnConnectionFailedListener connectionFailedListener) {
    // Create an instance of the Google Play services API client
    this.googleApiClient = new GoogleApiClient.Builder(context)
            .addConnectionCallbacks(connectionListener)
            .addOnConnectionFailedListener(connectionFailedListener)
            .addApi(LocationServices.API)
            .build();
}
 
開發者ID:davidmigloz,項目名稱:go-bees,代碼行數:16,代碼來源:LocationService.java

示例7: zzi

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public zzi(Context paramContext, Looper paramLooper, boolean paramBoolean, com.google.android.gms.common.internal.zzf paramzzf, Bundle paramBundle, GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
  super(paramContext, paramLooper, 44, paramzzf, paramConnectionCallbacks, paramOnConnectionFailedListener);
  this.zzbMe = paramBoolean;
  this.zzapu = paramzzf;
  this.zzbLN = paramBundle;
  this.zzaty = paramzzf.zzaty;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:9,代碼來源:zzi.java

示例8: zznd

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public zznd(Context paramContext, Lock paramLock, Looper paramLooper, zzf paramzzf, GoogleApiAvailability paramGoogleApiAvailability, Api.zza<? extends zzwz, zzxa> paramzza, Map<Api<?>, Integer> paramMap, List<GoogleApiClient.ConnectionCallbacks> paramList, List<GoogleApiClient.OnConnectionFailedListener> paramList1, Map<Api.zzc<?>, Api.zzb> paramMap1, int paramInt1, int paramInt2, ArrayList<zzmw> paramArrayList)
{
  this.mContext = paramContext;
  this.zzXP = paramLock;
  this.zzapI = new zzk(paramLooper, this.zzapX);
  this.zzoD = paramLooper;
  this.zzapO = new zza(paramLooper);
  this.zzaon = paramGoogleApiAvailability;
  this.zzaol = paramInt1;
  if (this.zzaol >= 0) {
    this.zzapV = Integer.valueOf(paramInt2);
  }
  this.zzapv = paramMap;
  this.zzapQ = paramMap1;
  this.zzapU = paramArrayList;
  Iterator localIterator1 = paramList.iterator();
  while (localIterator1.hasNext())
  {
    GoogleApiClient.ConnectionCallbacks localConnectionCallbacks = (GoogleApiClient.ConnectionCallbacks)localIterator1.next();
    this.zzapI.registerConnectionCallbacks(localConnectionCallbacks);
  }
  Iterator localIterator2 = paramList1.iterator();
  while (localIterator2.hasNext())
  {
    GoogleApiClient.OnConnectionFailedListener localOnConnectionFailedListener = (GoogleApiClient.OnConnectionFailedListener)localIterator2.next();
    this.zzapI.registerConnectionFailedListener(localOnConnectionFailedListener);
  }
  this.zzapu = paramzzf;
  this.zzaoo = paramzza;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:31,代碼來源:zznd.java

示例9: unregisterConnectionFailedListener

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public final void unregisterConnectionFailedListener(GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
  zzk localzzk = this.zzapI;
  zzx.zzC(paramOnConnectionFailedListener);
  synchronized (localzzk.zzqp)
  {
    if (!localzzk.zzaug.remove(paramOnConnectionFailedListener)) {
      Log.w("GmsClientEvents", "unregisterConnectionFailedListener(): listener " + paramOnConnectionFailedListener + " not found");
    }
    return;
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:13,代碼來源:zznd.java

示例10: registerConnectionFailedListener

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public final void registerConnectionFailedListener(GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
  zzx.zzC(paramOnConnectionFailedListener);
  synchronized (this.zzqp)
  {
    if (this.zzaug.contains(paramOnConnectionFailedListener))
    {
      Log.w("GmsClientEvents", "registerConnectionFailedListener(): listener " + paramOnConnectionFailedListener + " is already registered");
      return;
    }
    this.zzaug.add(paramOnConnectionFailedListener);
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:14,代碼來源:zzk.java

示例11: zzj

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
private zzj(Context paramContext, Looper paramLooper, zzl paramzzl, GoogleApiAvailability paramGoogleApiAvailability, int paramInt, zzf paramzzf, GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
  this.mContext = ((Context)zzx.zzb(paramContext, "Context must not be null"));
  this.zzoD = ((Looper)zzx.zzb(paramLooper, "Looper must not be null"));
  this.zzatM = ((zzl)zzx.zzb(paramzzl, "Supervisor must not be null"));
  this.zzaon = ((GoogleApiAvailability)zzx.zzb(paramGoogleApiAvailability, "API availability must not be null"));
  this.mHandler = new zzb(paramLooper);
  this.zzatV = paramInt;
  this.zzapu = ((zzf)zzx.zzC(paramzzf));
  this.zzRE = paramzzf.zzRE;
  this.zzXp = zzb(paramzzf.zzatw);
  this.zzatT = paramConnectionCallbacks;
  this.zzatU = paramOnConnectionFailedListener;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:15,代碼來源:zzj.java

示例12: zzn

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public zzn(Context paramContext, Looper paramLooper, GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener, String paramString, zzf paramzzf)
{
  super(paramContext.getApplicationContext(), paramLooper, 5, paramzzf, paramConnectionCallbacks, paramOnConnectionFailedListener);
  this.mContext = paramContext;
  this.zzbxg = paramString;
  this.zzUb = paramzzf.zzUb;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:8,代碼來源:zzn.java

示例13: connect

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
/**
 * Register the listeners and then connect the client.
 */
public static GoogleApiClient connect(GoogleApiClient client, ConnectedListener connected,
                                      OnConnectionFailedListener failed) {
    client.registerConnectionCallbacks(new ConnectionListener(connected));
    client.registerConnectionFailedListener(failed);
    client.connect();
    return client;
}
 
開發者ID:pushbit,項目名稱:sprockets-android,代碼行數:11,代碼來源:GoogleApiClients.java

示例14: initGoogleApiClient

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public void initGoogleApiClient(ConnectionCallbacks callbacks, OnConnectionFailedListener listener) {
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Plus.API)
            .addScope(Plus.SCOPE_PLUS_LOGIN)
            .addConnectionCallbacks(callbacks)
            .addOnConnectionFailedListener(listener)
            .build();
}
 
開發者ID:CheDream-Android,項目名稱:CheDream,代碼行數:9,代碼來源:BaseSocialActivity.java

示例15: c

import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; //導入依賴的package包/類
public final dg c(Context paramAnonymousContext, dt paramAnonymousdt, GoogleApiClient.ApiOptions paramAnonymousApiOptions, GoogleApiClient.ConnectionCallbacks paramAnonymousConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramAnonymousOnConnectionFailedListener)
{
  eg.b(paramAnonymousApiOptions, "Setting the API options is required.");
  eg.b(paramAnonymousApiOptions instanceof Cast.CastOptions, "Must provide valid CastOptions!");
  Cast.CastOptions localCastOptions = (Cast.CastOptions)paramAnonymousApiOptions;
  return new dg(paramAnonymousContext, localCastOptions.ks, Cast.CastOptions.a(localCastOptions), localCastOptions.kt, paramAnonymousConnectionCallbacks, paramAnonymousOnConnectionFailedListener);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:8,代碼來源:Cast.java


注:本文中的com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。