3

The newChooseAccountIntent() method from the AccountPicker allows you to customise the text in the AccountPicker "dialog" (actually an Activity) by way of the descriptionOverrideText argument:

public static Intent newChooseAccountIntent (Account selectedAccount, ArrayList<Account> allowableAccounts, String[] allowableAccountTypes, boolean alwaysPromptForAccount, String descriptionOverrideText, String addAccountAuthTokenType, String[] addAccountRequiredFeatures, Bundle addAccountOptions)

But the "dialog" also comes with a Title which is set by default to "Choose an account", for example as per the screenshot included in this post.

How do I customise this title, or even remove it entirely? The point is not so much that I want to change the wording, but that I want to be able to translate the wording into other languages... not great UI at the moment for users of my app that have everything else in their local language, but not the title of this "dialog".

Community
  • 1
  • 1
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
  • Since this is a Google proprietary API, there's no way of changing the text of the said dialog. You can check if the title itself uses i18n by changing the language of the system itself – adjuremods Jan 16 '16 at 09:05

2 Answers2

2

I know it is almost 5 years since the question was asked but recently I had the same problem and it was tough to find some help. Finally, I have solved it. You can't remove or customize the title. What can be done is to add a description below the title as String descriptionOverrideText, like this:

public static Intent newChooseAccountIntent (null, null, new String[]{"com.google"}, false, "HERE ADD SOME TEXT", null, null, null)
  • Thanks, but the original question already refers to the possibility of passing in a value for `descriptionOverrideText`... happy new year! – drmrbrewer Dec 31 '20 at 17:45
0

For AccountPicker use below code to change the title:

AccountPicker.newChooseAccountIntent(
            AccountPicker.AccountChooserOptions.Builder()
                    .setAllowableAccountsTypes(Arrays.asList("com.google"))
                    .setTitleOverrideText("change the title here")
                    .build())
Shanki Bansal
  • 1,681
  • 2
  • 22
  • 32