Tabnine Logo
Account
Code IndexAdd Tabnine to your IDE (free)

How to use
Account
in
com.google.android.gms.plus

Best Java code snippets using com.google.android.gms.plus.Account (Showing top 7 results out of 315)

origin: multidots/android-social-signin-helper

  public void signOut() {
    if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
      Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
      mGoogleApiClient.disconnect();
    }
  }
}
origin: mmazzarolo/easy-bookmarks

@Override
protected String doInBackground(Void... params) {
  String token = null;
  try {
    String scope = String.format("oauth2:%s", Scopes.PROFILE);
    token = GoogleAuthUtil.getToken(LoginActivity.this, Plus.AccountApi.getAccountName(mGoogleApiClient), scope);
  } catch (IOException transientEx) {
      /* Network or server error */
    Log.e(TAG, "Error authenticating with Google: " + transientEx);
    errorMessage = mStringNetworkError + transientEx.getMessage();
    showAlertDialog(errorMessage);
  } catch (UserRecoverableAuthException e) {
      /* We probably need to ask for permissions, so start the intent if there is none pending */
    Log.w(TAG, "Recoverable Google OAuth error: " + e.toString());
    if (!mGoogleIntentInProgress) {
      mGoogleIntentInProgress = true;
      Intent recover = e.getIntent();
      startActivityForResult(recover, RC_GOOGLE_LOGIN);
    }
  } catch (GoogleAuthException authEx) {
      /* The call is not ever expected to succeed assuming you have already verified that
       * Google Play services is installed. */
    Log.e(TAG, "Error authenticating with Google: " + authEx.getMessage(), authEx);
    errorMessage = mStringAuthError + authEx.getMessage();
    showAlertDialog(errorMessage);
  }
  return token;
}
origin: nglauber/dominando_android2

  login();
} else if (mGoogleApiClient.isConnected()) {
  Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
  Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient);
  mGoogleApiClient.disconnect();
  mGoogleApiClient.connect();
origin: mmazzarolo/easy-bookmarks

public void signOut() {
  if (mGoogleApiClient.isConnected()) {
    Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
    mGoogleApiClient.disconnect();
    mGoogleApiClient.connect();
  }
}
origin: youtube/yt-direct-lite-android

@Override
public void onConnected(Bundle bundle) {
  if (mGridView.getAdapter() != null) {
    ((UploadedVideoAdapter) mGridView.getAdapter()).notifyDataSetChanged();
  }
  setProfileInfo();
  mCallbacks.onConnected(Plus.AccountApi.getAccountName(mGoogleApiClient));
}
origin: tvbarthel/ChaseWhisplyProject

/** 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();
}
origin: hypeapps/FixMath

/** 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();
}
com.google.android.gms.plusAccount

Most used methods

  • clearDefaultAccount
  • getAccountName
  • revokeAccessAndDisconnect

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JOptionPane (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now