當前位置: 首頁>>代碼示例>>Java>>正文


Java Games.signOut方法代碼示例

本文整理匯總了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","","","","","");
	}
}
 
開發者ID:Magicrafter13,項目名稱:1946,代碼行數:13,代碼來源:GooglePlayServicesExtension.java

示例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();
        }
    }
 
開發者ID:MrStahlfelge,項目名稱:gdx-gamesvcs,代碼行數:16,代碼來源:GpgsClient.java

示例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();
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:29,代碼來源:GameHelper.java

示例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();
}
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:31,代碼來源:GameHelper.java

示例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();
}
 
開發者ID:Augugrumi,項目名稱:SpaceRace,代碼行數:29,代碼來源:GameHelper.java

示例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;
      }
  }
 
開發者ID:ezet,項目名稱:penguins-in-space,代碼行數:63,代碼來源:Example.java

示例7: signOut

import com.google.android.gms.games.Games; //導入方法依賴的package包/類
public void signOut() {
	if( isInitialized() && mGoogleApiClient.isConnected() ) {
		Games.signOut( mGoogleApiClient );
		mGoogleApiClient.disconnect();
	}
}
 
開發者ID:marpies,項目名稱:game-services-ane,代碼行數:7,代碼來源:GameServicesHelper.java


注:本文中的com.google.android.gms.games.Games.signOut方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。