【问题标题】:How to change HintRequest's dialog box with custom one?如何用自定义的改变 HintRequest 的对话框?
【发布时间】:2017-12-12 07:29:49
【问题描述】:

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

例如我想更改继续文本 这是我的代码示例:

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

【问题讨论】:

  • 你能找到答案吗?
  • 我也需要这个。默认选择器看起来很基本。
  • 你找到解决办法了吗?

标签: android android-dialog


【解决方案1】:

你可以试试这个

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

我在 Google 开发者网站上看到了 Reference

【讨论】:

  • 这个习俗如何?
猜你喜欢
  • 1970-01-01
  • 2014-07-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多