使用此代码我得到的东西就像第一张图片来选择相关帐户..我想要默认的选择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();
}
}
相反。
我想要这样的东西。