同意屏幕而不是电子邮件选择器

时间:2015-05-13 17:33:37

标签: android authentication google-plus google-plus-signin

使用此代码我得到的东西就像第一张图片来选择相关帐户..我想要默认的选择de google plus帐户并显示类似第二张图片的同意屏幕。

private synchronized GoogleApiClient buildGoogleApiClient() {
    GoogleApiClient.Builder builder = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API, Plus.PlusOptions.builder().build())
            .addScope(Plus.SCOPE_PLUS_LOGIN);

    return builder.build();
}

 private void resolveSignInError(ConnectionResult result) {
    if (mSignInIntent != null) {
        try {
            mSignInProgress = STATE_IN_PROGRESS;
            startIntentSenderForResult(mSignInIntent.getIntentSender(), RC_SIGN_IN, null, 0, 0, 0);

        } catch (IntentSender.SendIntentException e) {
            Log.i(TAG, "Sign in intent could not be sent: "
                    + e.getLocalizedMessage());
            mSignInProgress = STATE_SIGN_IN;
            mGoogleApiClient.connect();
        }
    } else {
        createErrorDialog().show();
    }
}

相反。

enter image description here

我想要这样的东西。

enter image description here

0 个答案:

没有答案