use of com.google.android.gms.auth.api.signin.GoogleSignInResult in project Android by Tracman-org.
the class LoginActivity method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
//Log.v(TAG, "requestCode was RC_SIGN_IN");
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleGoogleSignInResult(result);
} else // User just logged out. Don't log in again, stupid
if (requestCode == SIGN_OUT) {
//Log.v(TAG, "requestCode was SIGN_OUT");
DONT_LOG_IN = true;
}
}
use of com.google.android.gms.auth.api.signin.GoogleSignInResult in project coins-android by bubelov.
the class SignInActivity method onStart.
@Override
public void onStart() {
super.onStart();
OptionalPendingResult<GoogleSignInResult> pendingResult = Auth.GoogleSignInApi.silentSignIn(googleApiClient);
if (pendingResult.isDone()) {
// If the user's cached credentials are valid, the OptionalPendingResult will be "done"
// and the GoogleSignInResult will be available instantly.
GoogleSignInResult result = pendingResult.get();
handleSignInResult(result);
} else {
// If the user has not previously signed in on this device or the sign-in has expired,
// this asynchronous branch will attempt to sign in the user silently. Cross-device
// single sign-on will occur in this branch.
googleSignInButton.setEnabled(false);
pendingResult.setResultCallback(googleSignInResult -> {
googleSignInButton.setEnabled(true);
handleSignInResult(googleSignInResult);
});
}
}
use of com.google.android.gms.auth.api.signin.GoogleSignInResult in project coins-android by bubelov.
the class SignInActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_GOOGLE_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
Aggregations