Skip to content

Instantly share code, notes, and snippets.

@nowshad-hasan
Created February 18, 2020 07:55
Show Gist options
  • Save nowshad-hasan/37ecf82351960d1e2802a83eb9e9ab9e to your computer and use it in GitHub Desktop.
Save nowshad-hasan/37ecf82351960d1e2802a83eb9e9ab9e to your computer and use it in GitHub Desktop.
// Construct a request for phone numbers and show the picker
private void requestHint() {
HintRequest hintRequest = new HintRequest.Builder()
.setPhoneNumberIdentifierSupported(true)
.build();
GoogleApiClient apiClient= new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this) // implement the callbacks
.enableAutoManage(this, this)
.addApi(Auth.CREDENTIALS_API)
.build();
PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent(
apiClient, hintRequest);
startIntentSenderForResult(intent.getIntentSender(),
RESOLVE_HINT, null, 0, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment