Code example for PlusClient

Methods: clearDefaultAccount, connect, disconnect, isConnected

0
 
    /** 
     * Sign out of the app. 
     */ 
    public void signOut() { 
        if (mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        } 
 
        if (mIsConnecting || mPlusClient.isConnected()) {
            mPlusClient.disconnect();
            // Reconnect to get a new mPlusClient. 
            mLastConnectionResult = null;
            // Cancel sign in. 
            mRequestCode = INVALID_REQUEST_CODE;
 
            // Reconnect to fetch the sign-in (account chooser) intent from the plus client. 
            mPlusClient.connect();
        } 
    } 
 
    /** 
     * Revoke access to the current app.