当前位置: 首页>>代码示例>>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;未经允许,请勿转载。