本文整理匯總了Java中com.google.android.gms.games.Games.signOut方法的典型用法代碼示例。如果您正苦於以下問題:Java Games.signOut方法的具體用法?Java Games.signOut怎麽用?Java Games.signOut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.games.Games
的用法示例。
在下文中一共展示了Games.signOut方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Logout
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
@Override
public void Logout()
{
if (mGoogleApiClient != null && mGoogleApiClient.isConnected())
{
mSignInClicked= false;
Games.signOut(mGoogleApiClient);
mGoogleApiClient.disconnect();
Log.i("yoyo","Logged out of Google Play Services");
RunnerJNILib.OnLoginSuccess("Not logged in","-1","","","","","");
}
}
示例2: disconnect
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
public void disconnect(boolean autoEnd) {
if (isSessionActive()) {
Gdx.app.log(GAMESERVICE_ID, "Disconnecting with autoEnd " + autoEnd);
if (!autoEnd)
try {
Games.signOut(mGoogleApiClient);
} catch (Throwable t) {
// eat security exceptions when already signed out via gpgs ui
}
mGoogleApiClient.disconnect();
if (gameListener != null)
gameListener.gsOnSessionInactive();
}
}
示例3: signOut
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
/** Sign out and disconnect from the APIs. */
public void signOut() {
if (!mGoogleApiClient.isConnected()) {
// nothing to do
debugLog("signOut: was already disconnected, ignoring.");
return;
}
// for Plus, "signing out" means clearing the default account and
// then disconnecting
if (0 != (mRequestedClients & CLIENT_PLUS)) {
debugLog("Clearing default account on PlusClient.");
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
}
// For the games client, signing out means calling signOut and
// disconnecting
if (0 != (mRequestedClients & CLIENT_GAMES)) {
debugLog("Signing out from the Google API Client.");
Games.signOut(mGoogleApiClient);
}
// Ready to disconnect
debugLog("Disconnecting client.");
mConnectOnStart = false;
mConnecting = false;
mGoogleApiClient.disconnect();
}
示例4: signOut
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
/**
* Sign out and disconnect from the APIs.
*/
public void signOut() {
if (!mGoogleApiClient.isConnected()) {
// nothing to do
debugLog("signOut: was already disconnected, ignoring.");
return;
}
// for Plus, "signing out" means clearing the default account and
// then disconnecting
if (0 != (mRequestedClients & CLIENT_PLUS)) {
debugLog("Clearing default account on PlusClient.");
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
}
// For the games client, signing out means calling signOut and
// disconnecting
if (0 != (mRequestedClients & CLIENT_GAMES)) {
debugLog("Signing out from the Google API Client.");
Games.signOut(mGoogleApiClient);
}
// Ready to disconnect
debugLog("Disconnecting client.");
mConnectOnStart = false;
mConnecting = false;
mGoogleApiClient.disconnect();
}
示例5: signOut
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
/** Sign out and disconnect from the APIs. */
public void signOut() {
if (!mGoogleApiClient.isConnected()) {
// nothing to do
debugLog("signOut: was already disconnected, ignoring.");
return;
}
// for Plus, "signing out" means clearing the default account and
// then disconnecting
if (0 != (mRequestedClients & CLIENT_PLUS)) {
debugLog("Clearing default account on PlusClient.");
//Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
}
// For the games client, signing out means calling signOut and
// disconnecting
if (0 != (mRequestedClients & CLIENT_GAMES)) {
debugLog("Signing out from the Google API Client.");
Games.signOut(mGoogleApiClient);
}
// Ready to disconnect
debugLog("Disconnecting client.");
mConnectOnStart = false;
mConnecting = false;
mGoogleApiClient.disconnect();
}
示例6: onClick
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
Intent intent;
switch (v.getId()) {
case R.id.button_single_player:
case R.id.button_single_player_2:
// play a single-player game
resetGameVars();
startGame(false);
break;
case R.id.button_sign_in:
// user wants to sign in
// Check to see the developer who's running this sample code read the instructions :-)
// NOTE: this check is here only because this is a sample! Don't include this
// check in your actual production app.
if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) {
Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!");
}
// start the sign-in flow
Log.d(TAG, "Sign-in button clicked");
mSignInClicked = true;
mGoogleApiClient.connect();
break;
case R.id.button_sign_out:
// user wants to sign out
// sign out.
Log.d(TAG, "Sign-out button clicked");
mSignInClicked = false;
Games.signOut(mGoogleApiClient);
mGoogleApiClient.disconnect();
switchToScreen(R.id.screen_sign_in);
break;
case R.id.button_invite_players:
// show list of invitable players
intent = Games.RealTimeMultiplayer.getSelectOpponentsIntent(mGoogleApiClient, 1, 3);
switchToScreen(R.id.screen_wait);
startActivityForResult(intent, RC_SELECT_PLAYERS);
break;
case R.id.button_see_invitations:
// show list of pending invitations
intent = Games.Invitations.getInvitationInboxIntent(mGoogleApiClient);
switchToScreen(R.id.screen_wait);
startActivityForResult(intent, RC_INVITATION_INBOX);
break;
case R.id.button_accept_popup_invitation:
// user wants to accept the invitation shown on the invitation popup
// (the one we got through the OnInvitationReceivedListener).
acceptInviteToRoom(mIncomingInvitationId);
mIncomingInvitationId = null;
break;
case R.id.button_quick_game:
// user wants to play against a random opponent right now
startQuickGame();
break;
case R.id.button_click_me:
// (gameplay) user clicked the "click me" button
scoreOnePoint();
break;
}
}
示例7: signOut
import com.google.android.gms.games.Games; //導入方法依賴的package包/類
public void signOut() {
if( isInitialized() && mGoogleApiClient.isConnected() ) {
Games.signOut( mGoogleApiClient );
mGoogleApiClient.disconnect();
}
}