Ive been following the tutorial from Google Smart Lock , i can successfully save, start the account list Dialog:
However i dont want to use the popups from google to choose the accounts. I wonder if i can customise the Dialog in the second picture or : Is there a way i can retrieve all the credentials at once?
in the sample code i can see:
else if( status.getStatusCode() == CommonStatusCodes.RESOLUTION_REQUIRED ){
resolveResult(status, RC_CREDENTIALS_READ);
}
private void resolveResult(Status status, int requestCode) {
try {
status.startResolutionForResult(MainActivity.this, requestCode);
} catch (IntentSender.SendIntentException e) {
Log.e(TAG, "Failed to send Credentials intent.", e);
}
}
then in the source code of this status class:
I assume that its sending a pendingintent to another application?
Anyway, there's no way i can just retrieve the credentials at once if there are more than 1 credentials i saved.
Is it possible to do this?
I'm the product manager for Smart Lock at Google:
No, unfortunately, when multiple credentials are stored for the Google Account(s) on the device, a system dialog needs to be shown to allow the user to pick and this cannot be customized by the calling app. Only the credential selected by the user will be returned to the calling app for privacy and security reasons.
In practice, we find that most users use a single account for most apps, so auto sign-in is the most common scenario and the dialog is a much less common user flow.
Please leave a comment with any feedback on your concerns about the dialog or what you feel could be improved. Thanks!