Android PlusClient - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PlusClient class.

This code example shows how to use the following methods:isConnected
 
    public void updatePlusOne(View v) {
        if(v != null && v.getTag() != null) {
            ViewHolder holder = (ViewHolder) v.getTag();
 
            if(mPlusClient != null && mPlusClient.isConnected()) {
                holder.plusButton.setVisibility(View.VISIBLE);
                holder.plusButton.initialize(mPlusClient, holder.ytUrl, 1);
            } 
        } 
    } 
 
    static class ViewHolder { 
        public TextView titleView;
        public ResizableImageView thumbnailView;
        public PlusOneButton plusButton;
        public String ytUrl;
    } 
} 
6
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, disconnect, isConnected
        mConnectionResult = null;
        mAutoSignIn = false;
        mSignedIn = false;
        mSignInError = false;
 
        if (mPlusClient != null && mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        } 
        if (mGamesClient != null && mGamesClient.isConnected()) {
//            showProgressDialog(false); 
            mGamesClient.signOut(this);
        } 
 
        // kill connects to all clients but games, which must remain 
        // connected til we get onSignOutComplete() 
        killConnections(CLIENT_ALL & ~CLIENT_GAMES);		
	} 
	 
	public boolean silentSignIn() { 
		return signIn(); 

6
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, connect, disconnect, isConnected
 
    /** 
     * 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();
        } 
    } 

6
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, disconnect, isConnected
        mConnectionResult = null;
        mAutoSignIn = false;
        mSignedIn = false;
        mSignInError = false;
 
        if (mPlusClient != null && mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        } 
        if (mGamesClient != null && mGamesClient.isConnected()) {
            showProgressDialog(false); 
            mGamesClient.signOut(this);
        } 
 
        // kill connects to all clients but games, which must remain 
        // connected til we get onSignOutComplete() 
        killConnections(CLIENT_ALL & ~CLIENT_GAMES);
    } 
 
    /** 
     * Handle activity result. Call this method from your Activity's 

6
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, connect, disconnect, isConnected
 
    /** 
     * Sign out of the app. 
     */ 
    public void signOut() { 
        if (mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        } 
         
        if (mIsConnecting || mPlusClient.isConnected()) {
            mPlusClient.disconnect();
            resetAfterSignOut(); 
        } 
    } 
     
    /** 
     * Revoke the access token and completely disconnect from the app. 
     */ 
    public void disconnect(OnAccessRevokedListener listener) {
        if (mPlusClient.isConnected()) {

6
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, connect, disconnect, isConnected
 
    /** 
     * 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();
        } 
    } 

5
CodeRank
This code example shows how to use the following methods:connect, disconnect
			// connection errors. Wait until onConnected() to dismiss the 
			// connection dialog. 
			try { 
				result.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
			} catch (SendIntentException e) {
				mPlusClient.disconnect();
				mPlusClient.connect();
			} 
		} 
	} 
 
	@Override 
	public void onConnected() { 
		// TODO Auto-generated method stub 
		String accountName = mPlusClient.getAccountName();
		Toast.makeText(this, accountName + " is connected.", Toast.LENGTH_LONG)
				.show();
		btnSignIn.setText(getString(R.string.btn_signout));
		textUserName.setText(accountName);
		txtlogin.setVisibility(View.VISIBLE);
5
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, connect, disconnect, isConnected
     
    /** 
     * 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();
        } 
    } 

5
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, disconnect, isConnected
        mConnectionResult = null;
        mAutoSignIn = false;
        mSignedIn = false;
        mSignInError = false;
 
        if (mPlusClient != null && mPlusClient.isConnected()) {
            mPlusClient.clearDefaultAccount();
        } 
        if (mGamesClient != null && mGamesClient.isConnected()) {
            showProgressDialog(false); 
            mGamesClient.signOut(this);
        } 
 
        // kill connects to all clients but games, which must remain 
        // connected til we get onSignOutComplete() 
        killConnections(CLIENT_ALL & ~CLIENT_GAMES);
    } 
 
    /** 
     * Handle activity result. Call this method from your Activity's 

5
CodeRank
This code example shows how to use the following methods:clearDefaultAccount, disconnect, isConnected
                && mGamesClient.isConnected()) {
            mConnectedClients &= ~CLIENT_GAMES;
            mGamesClient.disconnect();
        } 
        if ((whatClients & CLIENT_PLUS) != 0 && mPlusClient != null
                && mPlusClient.isConnected()) {
            mConnectedClients &= ~CLIENT_PLUS;
            mPlusClient.disconnect();
        } 
        if ((whatClients & CLIENT_APPSTATE) != 0 && mAppStateClient != null
                && mAppStateClient.isConnected()) {
            mConnectedClients &= ~CLIENT_APPSTATE;
            mAppStateClient.disconnect();
        } 
    } 
     
    public void reconnectClients(int whatClients) {
        showProgressDialog(); 
         
        if ((whatClients & CLIENT_GAMES) != 0 && mGamesClient != null 

5
CodeRank

Related Android PlusClient Questions & Answers:

See Code Examples for Android PlusClient Methods: