本文整理汇总了Java中com.google.example.games.basegameutils.BaseGameUtils.resolveConnectionFailure方法的典型用法代码示例。如果您正苦于以下问题:Java BaseGameUtils.resolveConnectionFailure方法的具体用法?Java BaseGameUtils.resolveConnectionFailure怎么用?Java BaseGameUtils.resolveConnectionFailure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.example.games.basegameutils.BaseGameUtils
的用法示例。
在下文中一共展示了BaseGameUtils.resolveConnectionFailure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);
if (mResolvingConnectionFailure) {
Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
return;
}
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
}
switchToScreen(R.id.screen_sign_in);
}
示例2: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
return;
}
if (mGoogleApiClient != null && (mSignInClicked || mAutoStartSignInflow)) {
mSignInClicked = false;
mAutoStartSignInflow = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult, RC_SIGN_IN, getString(R.string.sign_in_failure));
} else {
//add sign in button
findViewById(R.id.signin).setVisibility(View.VISIBLE);
findViewById(R.id.progress).setVisibility(View.GONE);
findViewById(R.id.achv).setVisibility(View.GONE);
findViewById(R.id.scoreboard).setVisibility(View.GONE);
}
}
示例3: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
return;
}
if (mSignInClicked || mAutoStartSignInflow) {
mSignInClicked = false;
mAutoStartSignInflow = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult, RC_SIGN_IN, "Sign-in failed");
} else {
//remove sign out button - user is not signed in
findViewById(R.id.signout).setVisibility(View.GONE);
}
}
示例4: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
/**
* Attempt to reconnect to play services, or display error if connection fails.
*
* @param connectionResult
*/
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
// already resolving
return;
}
// if the sign-in button was clicked or if auto sign-in is enabled,
// launch the sign-in flow
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
// Attempt to resolve the connection failure using BaseGameUtils.
// The R.string.signin_other_error value should reference a generic
// error string in your strings.xml file, such as "There was
// an issue with sign-in, please try again later."
if (!BaseGameUtils.resolveConnectionFailure(this,
mGoogleApiClient, connectionResult,
RC_SIGN_IN, String.valueOf(R.string.signin_other_error))) {
mResolvingConnectionFailure = false;
}
}
}
示例5: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed(): attempting to resolve");
if (mResolvingConnectionFailure) {
Log.d(TAG, "onConnectionFailed(): already resolving");
return;
}
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
if (!BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult,
RC_SIGN_IN, getString(R.string.signin_other_error))) {
mResolvingConnectionFailure = false;
}
}
// Sign-in failed, so show sign-in button on main menu
mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting));
mMainMenuFragment.setShowSignInButton(true);
mWinFragment.setShowSignInButton(true);
}
示例6: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);
if (mResolvingConnectionFailure) {
Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
return;
}
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = BaseGameUtils
.resolveConnectionFailure(this, mGoogleApiClient,
connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
}
showSignInBar();
}
示例7: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed(): attempting to resolve");
if (mResolvingConnectionFailure) {
// Already resolving
Log.d(TAG, "onConnectionFailed(): ignoring connection failure, already resolving.");
return;
}
// Launch the sign-in flow if the button was clicked or if auto sign-in is enabled
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this,
mGoogleApiClient, connectionResult, RC_SIGN_IN,
getString(R.string.signin_other_error));
}
setViewVisibility();
}
示例8: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed(): attempting to resolve");
if (mResolvingConnectionFailure) {
Log.d(TAG, "onConnectionFailed(): already resolving, ignoring");
return;
}
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
if (!BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult,
RC_SIGN_IN, getString(R.string.signin_other_error))) {
mResolvingConnectionFailure = false;
}
}
showSignInBar();
}
示例9: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);
if (mResolvingConnectionFailure) {
Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
return;
}
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
}
showSignInBar();
}
示例10: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.d(TAG, "onConnectionFailed");
if (mIsResolving) {
// The application is attempting to resolve this connection failure already.
Log.d(TAG, "onConnectionFailed: already resolving");
return;
}
if (mSignInClicked || mAutoStartSignIn) {
mSignInClicked = false;
mAutoStartSignIn = false;
// Attempt to resolve the connection failure.
Log.d(TAG, "onConnectionFailed: begin resolution.");
mIsResolving = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
}
updateUI();
}
示例11: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
// Already resolving
return;
}
// If the sign in button was clicked or if auto sign-in is enabled,
// launch the sign-in flow
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
// Attempt to resolve the connection failure using BaseGameUtils.
// The R.string.signin_other_error value should reference a generic
// error string in your strings.xml file, such as "There was
// an issue with sign in, please try again later."
if (!BaseGameUtils.resolveConnectionFailure(this,
mGoogleApi, connectionResult,
RC_SIGN_IN, getString(R.string.signin_other_error))) {
mResolvingConnectionFailure = false;
}
}
}
示例12: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(@NonNull ConnectionResult result) {
Log.d(TAG, "onConnectionFailed(): attempting to resolve");
if (resolvingError) {
// Already resolving
Log.d(TAG, "onConnectionFailed(): ignoring connection failure, already resolving.");
return;
}
updateFromConnectionStatus();
// Launch the sign-in flow if the button was clicked or if auto sign-in is enabled
if (signInClicked || autoStartSignInFlow) {
autoStartSignInFlow = false;
signInClicked = false;
resolvingError = BaseGameUtils.resolveConnectionFailure(this, googleApiClient, result,
RC_SIGN_IN, getString(R.string.signin_other_error));
}
}
示例13: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
achievementsView.setVisibility(View.GONE);
rankView.setVisibility(View.GONE);
gamesView.setVisibility(View.GONE);
BaseGameUtils.resolveConnectionFailure(this, apiClient, connectionResult, 1801, R.string.msg_sign_in_error);
}
示例14: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
return;
}
if (mSignInClicked || mAutoStartSignInflow) {
mSignInClicked = false;
mAutoStartSignInflow = false;
mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult, RC_SIGN_IN, getString(R.string.sign_in_failure));
}
}
示例15: onConnectionFailed
import com.google.example.games.basegameutils.BaseGameUtils; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (mResolvingConnectionFailure) {
// Already resolving
return;
}
// If the sign in button was clicked or if auto sign-in is enabled,
// launch the sign-in flow
if (mSignInClicked || mAutoStartSignInFlow) {
mAutoStartSignInFlow = false;
mSignInClicked = false;
mResolvingConnectionFailure = true;
// Attempt to resolve the connection failure using BaseGameUtils.
// The R.string.signin_other_error value should reference a generic
// error string in your strings.xml file, such as "There was
// an issue with sign in, please try again later."
if (!BaseGameUtils.resolveConnectionFailure(this,
googleApiClient, connectionResult,
RC_SIGN_IN, getString(R.string.signin_other_error))) {
mResolvingConnectionFailure = false;
}
}
}