当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionResult.isSuccess方法代码示例

本文整理汇总了Java中com.google.android.gms.common.ConnectionResult.isSuccess方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionResult.isSuccess方法的具体用法?Java ConnectionResult.isSuccess怎么用?Java ConnectionResult.isSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.common.ConnectionResult的用法示例。


在下文中一共展示了ConnectionResult.isSuccess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConnectionFailed

import com.google.android.gms.common.ConnectionResult; //导入方法依赖的package包/类
@Override
public void onConnectionFailed( @NonNull ConnectionResult connectionResult ) {
	AIR.log( "GameServicesHelper | connection FAILED" );
	AIR.log( "Error message: " + connectionResult.getErrorMessage() );
	AIR.log( "Error code: " + connectionResult.getErrorCode() );

	if( !connectionResult.isSuccess() && connectionResult.hasResolution() ) {
		if( mPendingAchievementsUI ) {
			AIR.log( "GameServicesHelper | failed to connect with Google client, resolution available" );
			mPendingAchievementsUI = false;
			resolvePendingAchievementsUIError( connectionResult );
		}
		/* Start resolution intent only if the user requested auth himself */
		else if( mUserAuth ) {
			AIR.log( "GameServicesHelper | failed to connect with Google client, resolution available" );
			resolveSignInConnectionResult( connectionResult );
		} else {
			AIR.log( "GameServicesHelper | not starting auth resolution intent because user has not made the auth request himself" );
			mPendingConnectionResult = connectionResult;
		}
	} else {
		AIR.log( "GameServicesHelper | failed to connect with Google client, no resolution" );
	}
}
 
开发者ID:marpies,项目名称:game-services-ane,代码行数:25,代码来源:GameServicesHelper.java

示例2: initGoogleApiClient

import com.google.android.gms.common.ConnectionResult; //导入方法依赖的package包/类
private void initGoogleApiClient(GoogleApiClient googleApiClient) {
    if (!googleApiClient.isConnected()) {
        logger.log(TAG, "Google api client is not connected");
        logger.log(TAG, "Google api client connecting");
        ConnectionResult res = googleApiClient.blockingConnect();
        if (!res.isSuccess()) {
            throw new RuntimeException(THROWABLE_KEY_LOCATION);
        }
        logger.log(TAG, "Google api client connected");
    }
}
 
开发者ID:titanium-codes,项目名称:LocGetter,代码行数:12,代码来源:LocationGetterImpl.java

示例3: ensurePlayServicesConnection

import com.google.android.gms.common.ConnectionResult; //导入方法依赖的package包/类
private boolean ensurePlayServicesConnection() {
    ConnectionResult result = googleApiClient.blockingConnect();
    if (!result.isSuccess()) {
        GoogleApiAvailability.getInstance().showErrorNotification(this, result);

        return false;
    }

    return true;
}
 
开发者ID:matejdro,项目名称:WearVibrationCenter,代码行数:11,代码来源:WatchCommander.java

示例4: connectWithTimeout

import com.google.android.gms.common.ConnectionResult; //导入方法依赖的package包/类
@Override
public boolean connectWithTimeout(long timeout) {
    TraceEvent.begin("ChromeGoogleApiClientImpl:connectWithTimeout");
    try {
        ConnectionResult result = mClient.blockingConnect(timeout, TimeUnit.MILLISECONDS);
        if (!result.isSuccess()) {
            Log.e(TAG, "Connection to GmsCore unsuccessful. Error %d", result.getErrorCode());
        } else {
            Log.d(TAG, "Connection to GmsCore successful.");
        }
        return result.isSuccess();
    } finally {
        TraceEvent.end("ChromeGoogleApiClientImpl:connectWithTimeout");
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:16,代码来源:ChromeGoogleApiClientImpl.java


注:本文中的com.google.android.gms.common.ConnectionResult.isSuccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。