PlusClient connect - top ranked examples from Open Source projects

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

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, 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, 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, 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, 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, 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, isConnected, isConnecting
    private void handleResult(int resultCode) {
        if (resultCode == RESULT_OK) {
            // onActivityResult is called after onStart (but onStart is not 
            // guaranteed to be called while signing in), so we should make 
            // sure we're not already connecting before we call connect again. 
            if (!mPlusClient.isConnecting() && !mPlusClient.isConnected()) {
                mPlusClient.connect();
            } 
        } else { 
            Log.e(TAG, "Unable to sign the user in.");
            finish();
        } 
    } 
 
    @Override 
    public void onConnected(Bundle connectionHint) {
        mPersonListView.setAdapter(mListAdapter);
        mPlusClient.loadVisiblePeople(this, null);
    } 
 
5
CodeRank

Related PlusClient connect Questions & Answers:

connect Method Overview
Connects the client to Google Play services.
See Code Examples for other Android PlusClient Methods: