如何使用自定义对话框更改HintRequest的对话框?

时间:2017-12-12 07:29:49

标签: android android-dialog

我刚刚设法创建了hintRequest以获取用户的电话号码,现在我想更改它的自定义对话框或更改对话框的元素。

enter image description here

例如,我想更改继续文字 以下是我的代码示例:

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();
        }
    }

1 个答案:

答案 0 :(得分:-1)

您可以尝试

CredentialPickerConfig conf  = new CredentialPickerConfig.Builder()
                                  .setPrompt(CredentialPickerConfig.Prompt.SIGN_UP)
                                  .setShowAddAccountButton(true)
                                  .build();

我在Google开发人员网站上看到了它 Reference