本文整理汇总了Java中com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks类的典型用法代码示例。如果您正苦于以下问题:Java ConnectionCallbacks类的具体用法?Java ConnectionCallbacks怎么用?Java ConnectionCallbacks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionCallbacks类属于com.google.android.gms.common.api.GoogleApiClient包,在下文中一共展示了ConnectionCallbacks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final boolean handleMessage(Message paramMessage)
{
if (paramMessage.what == 1)
{
GoogleApiClient.ConnectionCallbacks localConnectionCallbacks = (GoogleApiClient.ConnectionCallbacks)paramMessage.obj;
synchronized (this.zzqp)
{
if ((this.zzauh) && (this.zzaud.isConnected()) && (this.zzaue.contains(localConnectionCallbacks))) {
localConnectionCallbacks.onConnected(null);
}
return true;
}
}
Log.wtf("GmsClientEvents", "Don't know how to handle message: " + paramMessage.what, new Exception());
return false;
}
示例2: registerConnectionCallbacks
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final void registerConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
zzx.zzC(paramConnectionCallbacks);
synchronized (this.zzqp)
{
if (this.zzaue.contains(paramConnectionCallbacks))
{
Log.w("GmsClientEvents", "registerConnectionCallbacks(): listener " + paramConnectionCallbacks + " is already registered");
if (this.zzaud.isConnected()) {
this.mHandler.sendMessage(this.mHandler.obtainMessage(1, paramConnectionCallbacks));
}
return;
}
this.zzaue.add(paramConnectionCallbacks);
}
}
示例3: WearableConnectivity
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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();
}
示例4: J
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final void J(int paramInt)
{
this.mHandler.removeMessages(1);
while (true)
{
int i;
synchronized (this.pt)
{
this.pv = true;
ArrayList localArrayList2 = this.pt;
i = 0;
int j = localArrayList2.size();
if ((i < j) && (this.ps.bp()))
{
if (this.pt.contains(localArrayList2.get(i)))
((GoogleApiClient.ConnectionCallbacks)localArrayList2.get(i)).onConnectionSuspended(paramInt);
}
else
{
this.pv = false;
return;
}
}
i++;
}
}
示例5: registerConnectionCallbacks
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final void registerConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
eg.f(paramConnectionCallbacks);
synchronized (this.pt)
{
if (this.pt.contains(paramConnectionCallbacks))
{
new StringBuilder("registerConnectionCallbacks(): listener ").append(paramConnectionCallbacks).append(" is already registered");
}
else
{
if (this.pv)
this.pt = new ArrayList(this.pt);
this.pt.add(paramConnectionCallbacks);
}
}
if (this.ps.isConnected())
this.mHandler.sendMessage(this.mHandler.obtainMessage(1, paramConnectionCallbacks));
}
示例6: unregisterConnectionCallbacks
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final void unregisterConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
eg.f(paramConnectionCallbacks);
synchronized (this.pt)
{
if (this.pt != null)
{
if (this.pv)
this.pt = new ArrayList(this.pt);
if (!this.pt.remove(paramConnectionCallbacks))
new StringBuilder("unregisterConnectionCallbacks(): listener ").append(paramConnectionCallbacks).append(" not found");
else if ((this.pv) && (!this.pu.contains(paramConnectionCallbacks)))
this.pu.add(paramConnectionCallbacks);
}
return;
}
}
示例7: h
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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);
}
示例8: createGoogleWearableAPIClient
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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();
}
示例9: setListeners
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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();
}
示例10: zzi
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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;
}
示例11: zznd
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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;
}
示例12: unregisterConnectionCallbacks
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
public final void unregisterConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
zzk localzzk = this.zzapI;
zzx.zzC(paramConnectionCallbacks);
synchronized (localzzk.zzqp)
{
if (!localzzk.zzaue.remove(paramConnectionCallbacks)) {
Log.w("GmsClientEvents", "unregisterConnectionCallbacks(): listener " + paramConnectionCallbacks + " not found");
}
while (!localzzk.zzauj) {
return;
}
localzzk.zzauf.add(paramConnectionCallbacks);
}
}
示例13: zzj
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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;
}
示例14: zzn
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的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;
}
示例15: onConnectionSuspended
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; //导入依赖的package包/类
@Override
public void onConnectionSuspended(int i) {
// If your connection gets lost at some point,
// you'll be able to determine the reason and react to it here.
if (i == ConnectionCallbacks.CAUSE_NETWORK_LOST) {
Utils.logDebug(TAG, "Connection lost. Cause: Network Lost.");
} else if (i == ConnectionCallbacks.CAUSE_SERVICE_DISCONNECTED) {
Utils.logDebug(TAG, "Connection lost. Reason: Service Disconnected");
}
// Send the hint to Activity for UI updates
((MainActivity) mActivity).onFitStatusUpdated(false);
// Attempt to reconnect
connect();
}