我刚刚设法创建 hintRequest 以获取用户的电话号码,现在我想用自定义对话框更改它的对话框或更改对话框的元素。
例如我想更改Continue with文本 这是我的代码示例:
private void requestHint() {
apiClient = new GoogleApiClient.Builder(this)
.addApi(Auth.CREDENTIALS_API)
.build();
CredentialPickerConfig conf = new CredentialPickerConfig.Builder()
.setShowAddAccountButton(true)
.build();
HintRequest hintRequest = new HintRequest.Builder()
.setPhoneNumberIdentifierSupported(true)
.setHintPickerConfig(conf)
.build();
PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent(
apiClient, hintRequest);
try {
startIntentSenderForResult(intent.getIntentSender(),
RESOLVE_HINT, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
}
最佳答案
你可以试试这个
CredentialPickerConfig conf = new CredentialPickerConfig.Builder()
.setPrompt(CredentialPickerConfig.Prompt.SIGN_UP)
.setShowAddAccountButton(true)
.build();
我是在 Google 开发者网站上看到的 Reference
关于android - 如何用自定义对话框更改 HintRequest 的对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47767307/