protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            mGoogleApiClient = (new GoogleApiClient.Builder(this)).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build();

            mGoogleLoginClicked = true;
            if (!mGoogleApiClient.Connecting)
            {
                if (mGoogleConnectionResult != null)
                {
                    resolveSignInError();
                }
                else if (mGoogleApiClient.Connected)
                {
                    GoogleOAuthTokenAndLogin;
                }
                else
                {
                    /* connect API now */
                    Log.d(TAG, "Trying to connect to Google API");
                    mGoogleApiClient.connect();
                }
            }
        }
Example #2
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);

            ContentView = R.layout.activity_login;

            /* Load the Google login button */
            SignInButton googleLoginButton = (SignInButton)findViewById(R.id.login_with_google);

            googleLoginButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
            /* Setup the Google API object to allow Google+ logins */
            mGoogleApiClient = (new GoogleApiClient.Builder(this)).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN).build();
        }