當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。