我正在使用GoogleApiClient
构建的enableAutoManage
:
GoogleApiClient.Builder(activity)
.enableAutoManage(activity) { result ->
if (!result.hasResolution()) {
GoogleApiAvailability.getInstance().showErrorDialogFragment(activity, result.errorCode, 0)
}
else {
try {
result.startResolutionForResult(activity, errorResolutionRequestCode)
} catch (e: SendIntentException) {
Log.e(TAG, "Exception while starting resolution activity", e)
}
}
}
.addApi(Auth.GOOGLE_SIGN_IN_API, buildGoogleSignInOptions(googleAuthId))
.build()
我怎么知道connect()
操作是否因为播放服务未更新而失败?
仅当用户关闭对话框(自动提示)时才会调用OnConnectionFailed
回调,但在任何情况下我都需要回调来执行某些UI操作。有没有办法实现这个目标?