本文整理汇总了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" );
}
}
示例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");
}
}
示例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;
}
示例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");
}
}